Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: chris smith
  Where is chris smith?
 Yorkshire CH CH
 Barbados
 chris smith
 Tags
Subject: RE: how to speed up a query
Thread ID: 155380 Message ID: 155394 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Monday, December 31, 2007 3:33:33 PM         
   


> Hello all
>
> I have the folowing select statment in the init event of a form and it takes "forever" to display the data, (about 150000 record in the table). Only one table is involved in the query and it has a primary index on salesno field. I tried sys(3054,11) and it says that rushmore optimization is none. How can I speed up this query.
>
>
>
thisform.grid1.recordsource = "SELECT Sale.salesno, Sale.saledate,Sale.custid, Sale.empid, Sale.total FROM salesclerk!sale where Sale.sus <> .T. and Sale.saledate == thisform.date ORDER BY Sale.salesno DESC into cursor viewreprint"

>
> cheers
> smith

thisform.grid1.recordsource = ;
 "SELECT salesno, saledate,custid, empid, total"+;
 " FROM salesclerk!sale"+;
 " where Sale.saledate == thisform.date and !Sale.sus"+;
 " ORDER BY salesno DESC into cursor viewreprint"


At least have an index on saledate. Having a binary index on "sus" and deleted() might help further (but test it first, it might work against you as well).

Cetin Basoz

ENTIRE THREAD

how to speed up a query Posted by chris smith @ 12/31/2007 1:47:42 PM
RE: how to speed up a query Posted by Mike Gagnon @ 12/31/2007 2:04:44 PM
RE: how to speed up a query Posted by chris smith @ 12/31/2007 2:21:26 PM
RE: how to speed up a query Posted by Cetin Basoz @ 12/31/2007 3:33:33 PM
RE: how to speed up a query Posted by Ken Murphy @ 1/4/2008 1:20:40 AM