Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
index and speed |
Fri, May 19 2006 11:57 AM | Permanent Link |
"Harry de Boer" | LS
Given the table vh2 where the fields jaar and maand are of type integer and the sql expression is: select distinct jaar, maand from vh2 order by jaar, maand what would be better (faster): seperate indexes on each field or one combined index (with the two fields). I could have tried it -I know-but I want to know why one of of them -if so- is faster too. Maybe one could give me some info about when to use combined indexfields in an index (or point me to an article). Any help would be great! Regards, Harry |
Fri, May 19 2006 2:05 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Harry
I'm sure that someone will correct me. My understanding is that DBISAM only uses the first field of an index in the selection process (it might refer specifically to the WHERE clause and have nothing to do with DISTINCT) so to optimise performance on the selection you need two indices. However, on the ORDER BY it will (I think) use compound indices. I could be wrong and that might only apply to tables. My best guess is two separate indices will be best all round. Roy Lambert |
Fri, May 19 2006 5:55 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Roy,
<< I'm sure that someone will correct me. My understanding is that DBISAM only uses the first field of an index in the selection process (it might refer specifically to the WHERE clause and have nothing to do with DISTINCT) so to optimise performance on the selection you need two indices. However, on the ORDER BY it will (I think) use compound indices. I could be wrong and that might only apply to tables. >> You are 100% correct. The optimization rules are here: http://www.elevatesoft.com/dbisam4d5_optimizations.htm -- Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Sunday, May 5, 2024 at 10:18 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |