Re: Extensions and/or Multi Column Indexes
Date: Wed, 9 Jan 2019 10:36:37 +0000
Message-ID: <CWXP265MB04082030918F00974BCFD197A58B0_at_CWXP265MB0408.GBRP265.PROD.OUTLOOK.COM>
If you have a multi-column index and use equality on all columns of that index (whether in a join or in a simple table access) the optimizer will use the distinct_keys value for the index in cardinality calculations in all the cases where it could otherwise use extended stats.
Possibly the only cse where you would want a column group that is an exact match for the index is when you have a histogram on one (or more) of the columns in the index. Oracle will not use the distinct_keys in that case. If you want it to do so you have to drop the histogram on the base column(s) or create a column group for the index and generate a historgam on the column group.
Regards
Jonathan Lewis
From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on behalf of Martin Klier - Performing Databases GmbH <martin.klier_at_performing-db.com> Sent: 09 January 2019 10:25:19
To: Oracle-L Freelists
Subject: CBO: Extensions and/or Multi Column Indexes
Hi listers,
I was wondering if it is useful to still have manually created extended statistics (to enhance cardinality calculation for logically connected columns) and multi-column indexes of the same columns at the same time.
I need the two- or three-column indexes for query performance reasons anyway, so leaving them out is not an option.
Thank you in advance, and please don't laugh if I am way off the path... :)
Best regards
--
Martin Klier // Performing Databases GmbH
Managing Partner // Senior DB Consultant
Oracle ACE Director
martin.klier_at_performing-db.com // https://www.performing-databases.com
--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jan 09 2019 - 11:36:37 CET