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:
00352776
Views:
14
>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.

All the Booleans (and, or) can slow it down considerably. One solution is to break it up into 2 (or more) SELECTs into cursors along the way.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform