Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 20 of 31 total
Thread Faster Way to Retrieve Records?
Fri, Apr 24 2015 6:24 PMPermanent Link

Steve Gill

Avatar

Hi Roy,

<< Out of interest what is it you're actually assigning to? It can't just be a simple string which is what I used - can it?  >>

I'm adding the values to a dynamic array. I removed that code to simplify the example. I have tested with and without the dynamic array and it makes little difference.

<< Also if you have the time try using a simple query rather than an SP >>

I'll give that a try.

Thanks,

Steve
Sat, Apr 25 2015 3:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


I assume a two dimensional array. If so are you "pre-sizing" it or adding as you go? I don't know if the same applies but the difference in populating a largish stringlist varies a lot depending on how capacity is set at the start.

The other thing to test is just do a while not eof  / next loop to see how much time is spent in navigating the result set and how much accessing the data and stuffing into the array.

Roy Lambert
Sat, Apr 25 2015 7:30 PMPermanent Link

Steve Gill

Avatar

Hi Roy,

<< I assume a two dimensional array. If so are you "pre-sizing" it or adding as you go? I don't know if the same applies but the difference in populating a largish stringlist varies a lot depending on how capacity is set at the start. >>

I am pre-sizing, eg. SetLength(MyArray, FStoredProcedure.RecordCount);

<< The other thing to test is just do a while not eof  / next loop to see how much time is spent in navigating the result set and how much accessing the data and stuffing into the array. >>

It turns out that navigating the result set is what takes the time.  I have stripped out all code from the loop, except for FStoredProcedure.Next, and it takes 15 to 16 seconds.  I have tried for/while/repeat loops but they all take the same amount of time.  BTW, session type is Remote.

= Steve
Sun, Apr 26 2015 3:05 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


>It turns out that navigating the result set is what takes the time. I have stripped out all code from the loop, except for FStoredProcedure.Next, and it takes 15 to 16 seconds. I have tried for/while/repeat loops but they all take the same amount of time. BTW, session type is Remote.

Lookup

TEDBDataSet.RemoteReadSize Property

in the manual - experiment

Roy
Sun, Apr 26 2015 1:07 PMPermanent Link

Ideal Software Systems

>>You will see about a 20% improvement just by recompiling in XE8 due to the changes in how values are read and written in TField.
>That must be a first

Indeed
Sun, Apr 26 2015 5:53 PMPermanent Link

Steve Gill

Avatar


<< Lookup

TEDBDataSet.RemoteReadSize Property

in the manual - experiment >>

Thanks Roy, already tried that. Smile

I have emailed Tim so I'll see if he has any suggestions.

= Steve
Mon, Apr 27 2015 2:26 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


>I have emailed Tim so I'll see if he has any suggestions.

Make sure you let us know the answer

Roy
Thu, May 7 2015 6:47 PMPermanent Link

Steve Gill

Avatar

<< Make sure you let us know the answer >>

Turns out it was the table encryption causing the problem (Tim discovered it).  Once I disabled the encryption it went from 16 seconds to less than 0.5 seconds to iterate through all of the records!!

Thanks Tim!

= Steve
Thu, May 7 2015 11:02 PMPermanent Link

Barry

Steve Gill wrote:

>Turns out it was the table encryption causing the problem (Tim discovered it).  Once I disabled the encryption it went from 16 seconds to less than 0.5 seconds to iterate through all of the records!!<

So decrypting the data took 32x longer than actually retrieving and sending the data over the network to the client??? From my experience encryption usually adds 20% to the overall query time. Is there something odd with Stored Procedures that increases the decryption time so much?

Barry
Fri, May 8 2015 2:29 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Barry


>>Turns out it was the table encryption causing the problem (Tim discovered it). Once I disabled the encryption it went from 16 seconds to less than 0.5 seconds to iterate through all of the records!!<
>
>So decrypting the data took 32x longer than actually retrieving and sending the data over the network to the client??? From my experience encryption usually adds 20% to the overall query time. Is there something odd with Stored Procedures that increases the decryption time so much?

Total guess here but my take would be its a mixture of transport and decryption times. Still seems high though

Roy
« Previous PagePage 2 of 4Next Page »
Jump to Page:  1 2 3 4
Image