On Tue, Aug 24, 2010 at 1:57 PM, Kent Belan <[email protected]> wrote: > Hello, > > I have been fixing slow parts in our program and came across something I > don't understand. > > I have my desktop setup as the server and my laptop as a workstation with a > mapped drive to the desktop. I created a shortcut on the laptop that runs > the EXE from the desktop. This works fine for testing. I have coverage logs > to trace the program and find the slow spots. > > So, why is this slow ? > > Select * from tickets ; > where ticketno = 123 into cursor tTickets > * this pulls a query with 1 ticket > > Select tTickets > Go top > Do while .not. Eof() > * do some stuff > select tTickets > skip 1 > Enddo > > The program delays on the go top line for 32 seconds and the skip 1 line for > 12 seconds. > > I changed the code to: > > Select tTickets > Scan > * do stuff > Endscann > > And there is not delay. So why is there a delay with the first method ? -----------------
You are really working off the entire table and the "cursor" is a fake selection of only one row out of the entire table. why not do the : Scan for ticketno = 123 do_stuff end scan -- Stephen Russell Sr. Production Systems Programmer CIMSgts 901.246-0159 cell _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

