Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 3 of 3 total |
SELECT don't use all fields of an Index |
Wed, Mar 29 2006 9:17 AM | Permanent Link |
Assoes | Hi
I have a select than use two fields, this two fields are in an index of the table. But the select only use the first field of the index. The plan indicates that the WHERE is partially optimized; but the index is the two fields (Codi_caixa + Numero_tiquet). Why the WHERE is not optimized ? Regards Robert ================================================================================ SQL statement (Executed with 4.21 Build 10) ================================================================================ SELECT * FROM TIQ_LIN WHERE "Codi_caixa" = '01' AND "Numero_tiquet" = '00100000' Tables Involved --------------- TIQ_LIN (TIQ_LIN) table opened shared, has 500502 rows Result Set Generation --------------------- Result set will be live Result set will consist of one or more rows Result set will be ordered by the primary index for the table TIQ_LIN WHERE Clause Execution ---------------------- The expression: "Codi_caixa" = '01' AND "Numero_tiquet" = '00100000' is PARTIALLY-OPTIMIZED, covers 500435 rows or index keys, costs 189714908 bytes, and will be applied to the TIQ_LIN table (TIQ_LIN) before any joins ================================================================================ >>>>> 1 rows affected in 13,484 seconds ================================================================================ |
Wed, Mar 29 2006 9:46 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Assoes
DBISAM only uses the first part of any compound index (apart from ordering) if you want to fully optimise the query you'll have to create a second index on Numero_tiquet Roy Lambert |
Wed, Mar 29 2006 12:37 PM | Permanent Link |
Assoes | > DBISAM only uses the first part of any compound index (apart from ordering) if you want to fully optimise the query you'll have to create a second index on Numero_tiquet > Thank you Roy, this works perfect. Regards Robert |
This web page was last updated on Monday, May 6, 2024 at 03:23 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |