Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP6.0 Optimize SQL
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00352764
Message ID:
00352783
Views:
7
>Hi All,
>
>I'd like to speed up my sql select statement and have tried everything I could think of to make it "Rushmore" optimized, to no avail.
>
>Here are two sql's, the first is slow, the second is fast.
>
>
>***5,323 records in 40.03 secs.
>select dam1, yr_bred, name, sex, sire1, booked_to, last_bred, p_b, date_foal, date_died, cause_deat, ;
>price_sold, buy_name, age_rec, life_earn, cl from master where category = "F" and type = "S" or ;
>type = "W" or type = "Y" order by dam1 into table foals nofilter
>
>
>***378 records in 4.31 secs.
>select name, yr_foaled, booked_to, yr_bred, age_rec, life_earn, sire1, dam1, sire2, date_acqui, purch_pric, bought_fro, hands, descript from master where category = "F" and type = "B" and ;
>date_died = {} and date_sold = {} and yr_bred = 2000 order by name into table mare nofilter
>
>The number of records returned doesn't seem to be a factor because I can revise the sql's to change the results set's numbers and the time to run remains about the same.
>
>I know there's something wrong with the slow sql, but I need help figuring it out.
>
>One thing I did try was to create an index tag in the cdx for deleted(), but it didn't help.
>
>The files are indexed on the first field noted in the select.
>
>Any ideas would be helpful and appreciated.

For the first SQL statement, do you have an index on Category and Type? Are you pulling this data accross a network?
Chris McCandless
Red Sky Software
Previous
Reply
Map
View

Click here to load this message in the networking platform