Hello Kevin,
Thanks for the NOFILTER option. This seems to be working and fixed the slow
spots.

I asked the 3 other developers on the team and they had never heard about
this.

Nice to learn a new trick,

Thanks,
Kent 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Kevin Cully
Sent: Tuesday, August 24, 2010 3:06 PM
To: [email protected]
Subject: Re: Why is this SLOW ...

Your query may have just set a filter on the table Tickets instead of truly
creating a cursor.

Try:

SELECT * FROM Tickets WHERE TicketNo=123 INTO CURSOR tTickets NOFILTER

The above should truly give you a cursor with just one record in it. 
You can do a test by issuing a MESSAGEBOX(DBF("tTickets")) with each
methodology to be sure.

-Kevin


On 08/24/2010 02:57 PM, Kent Belan wrote:
> 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



_______________________________________________
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.

Reply via email to