Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select distinct & rushmore optimization
Message
From
24/10/2005 11:53:44
 
 
To
24/10/2005 11:28:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01061610
Message ID:
01061616
Views:
14
>So I have a table with close to a milion records and one of the fields called rcode char(6) contains codes, about 300 distinct values in the whole table.
>
>I need a way to get the list of unique values. It seems like neither of the following quesries are optimizable (according to sys(3054,11) there is no optmization used and the queries are slow)
>
>select distinct rcode from testtable
>select rcode from testtable group by rcode
>
>Any idea on how to get the list of unique values with an optimizeable query?
>
>thank you
>
>Sorin

Sorin,

I think the distinct is applied after the data has been fetched

Maybe a scan can help where you add one to the last char of rcode (and if that becomes 256, make it 0 and add one to the char before), then seek() fro the next
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform