Page 2 of 2

Posted: 18.01.2013, 11:19
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.

Posted: 19.01.2013, 20:59
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???

Posted: 21.01.2013, 13:02
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.

Posted: 22.01.2013, 22:21
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!

Posted: 23.01.2013, 13:40
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?

Posted: 30.01.2013, 21:21
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, ...)