Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL select is slow in large tables
Message
From
19/06/1998 11:23:25
 
 
To
19/06/1998 11:20:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00109911
Message ID:
00109916
Views:
42
>>>I have this table with about 90,000 records. The table is about 47 mb in size.Some of the fields are Invoice number, invoice date, active flag. If I do a select on these fields as so:
>>>
>>>SELECT inv_number from INVTable WHERE YEAR(inv_date) = 1997 and REC_active into a cursor/table/array
>>>
>>>There is an index on inv_number and the table is type FPW2.6
>>>
>>>The result set is about 30000 records. In VFP 5.0a this is slow. Takes about>2 mins and sometimes runs out of memory if into an array. I read somewhere some time ago that there is a sys() function that improves the memory management of vfp and speeds up the select.
>>>
>>>I dread to think what would happen if I needed to extract from 2 tables using a join condition!
>>>
>>>Does someone out there working with large tables have any ideas? A view is not what I'm looking for, parametised or otherwise.
>>>
>>>Thanks in advance
>>>
>>>Bernard
>>
>>You should have index tag on YEAR(inv_date) and another one on Rec_active.
>
>Lets say I want to do it without indexes! Why is it still so slow??
>Do you know about or have you read about that sys() command??

You must use indexes to optimize any query. I see that you heard something about SYS(3054), but this is just for checking/tuning purposes.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform