Smart refresh using zeos components

In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions

Moderators: gto, EgonHugeist

slai
Senior Boarder
Senior Boarder
Posts: 53
Joined: 07.07.2006, 10:45
Location: office

Post by slai »

I know that it does not make really sense to do this on a big varchar field, but sometimes it is needed, because of many searches on that and so on, and the index statistic for that field gives me 0.00042... and that is a good value for an index and there are only 2900 Records in that Table.

I've checked it on Zeos 6.6 as well now and the performance decrease also happens there. As soon as i do SBEZEICHNUNG Asc on the IndexFieldNames on ZTable.

But i need this sort ordering on that field, and the field also could not be shorter than 500.

There should be also mentioned that this performance decrease only happens if it goes over the network. If i have a Firebird 2.1.5 local on my laptop it takes about 1 second.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

slai,

do you have an index on SBEZEICHNUNG? Now we do not longer talk about a Zeos-related issue. Anybody else? Some suggestions, hints???
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
slai
Senior Boarder
Senior Boarder
Posts: 53
Joined: 07.07.2006, 10:45
Location: office

Post by slai »

It's ok i do an internal refactoring to this, and will write my solution as soon as it performans as it should.
slai
Senior Boarder
Senior Boarder
Posts: 53
Joined: 07.07.2006, 10:45
Location: office

Post by slai »

So, mainly the Performance Issues came from ZTable -> Refres, IndexFieldNames and Sorting. Is it correct that when i set SortType it imediatly begins with loading all datas and this SortType? Because i do first .refresh then setting SortedFields and then SortType. Now if 2 times refreshing then it is an imense overhead. Is there a possibility to set SortType and SortedFields and then just 1 refresh?

Thx for reply!
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

slai,

Why don't you set these options before you open the table? Do you use Master-Detail relations? The ZTable component is a simple dataset which fetches all rows. You can supress this behavior by using the TZQuery and your own statement with a order clause. I've still my problems to understand what exactly you're doing. Again is there an index for field SBEZEICHNUNG avaiable?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

As far as I remember these IndexFieldnames and Sorting stuff is clientside sorting inside the dataset buffers. So indeed, it's logical that all data needs to be loaded at refresh time and when changing these settings.
When loading bigger datasets it's probably better to let the query do the sorting. In that case the data can be fetched in batches. But make sure you don't navigate to the end of the dataset in your code. (eg. by using recordcount, ds.last, ...)
Image
Post Reply