Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to create index with 2 fields 1st ascending 2nd des
Message
From
24/10/2006 16:48:01
 
 
To
24/10/2006 16:38:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01164071
Message ID:
01164193
Views:
16
>>Hi all, i just need to create a index to show by client the invoices but keeping for each client their invoices in descending order, from the newest to the oldest. This index must be created on the table structure. Any ideas.?
>>
>>Thanks,
>
>If it is for a report, I wouldn't create an index at all.
>
>
>select [fieldlist] from [table];
>  order by Field1 asc, Field2 desc;
>  where [some condition];
>  into cursor Tmp
>report form ...
>
I agree wholeheartedly. One of the "good database design" rules is never to create a compound index for a single purpose, unless there are no alternatives. In this case, an index on each of the relevent fields will make your query fully optimized, and thus extremely fast. Maintaining a compound index, on the other hand, will make the table update slowly, and for "nothing".
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform