Тёмный

How do I tune a SQL statement when the Optimizer picks the wrong index? 

Maria Colgan (SQLMaria)
Подписаться 4,4 тыс.
Просмотров 6 тыс.
50% 1

Understanding why the Optimizer makes a decision and providing the necessary information and access methods to allow the Optimizer to pick the plan you want by default can be challenging. But don't give in to the overwhelming temptation to use a hint to brut force the plan you want. In this short video, I explain why the Optimizer didn't choose the index folks were expecting, how to identify these types of problems and provide you with the solution. Hopefully, you will be able to apply the lessons shown in this video to your SQL Tuning tasks on your own systems!

Опубликовано:

 

15 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@albertogonzalez5114
@albertogonzalez5114 2 года назад
Thanks so much Maria, whishing you a great 2022!
@omarc4ut
@omarc4ut 2 года назад
Bravo, thank you very much for all the information that you share. Delivery is beautiful.
@samirpophalkar
@samirpophalkar 2 года назад
This is very informative videos Maria. Can you please also help me to understand which statistics optimizer refer while doing two or more table joins.. if you can just highlight any blog or Doc, will also a great help. Thank you
@JeffSmiththat
@JeffSmiththat 2 года назад
Thanks for doing the maths for us!
@SQLMaria
@SQLMaria 2 года назад
Any time Jeff!
@jamsher731
@jamsher731 2 года назад
Hi Maria can you please explain How you get Value : 0.013 for Cost of index range scan with filter predicate (at 5:00 ) I notice you showed formula 1/NDV of column - Can please let us know which column NDV was used either PROD_ID or CUST_ID.
@SQLMaria
@SQLMaria 2 года назад
Hi Jamsher, the column in question is Column 1 of the index. In this case, that's the PROD_ID column.
@trichymahesh1
@trichymahesh1 2 года назад
Great information
@finaruliviu7701
@finaruliviu7701 2 года назад
The Avatar Lady is very funny 😺
@atifiu
@atifiu 2 года назад
Hi Maria, between 7 min and 7:30 min in the video you said that only in 2nd plan i.e. expected plan only prod id is used as access predicate but that is not the case in the plan both prod id and cust id are used as access predicate and then in filter predicate custid is used again to filter the records. Could you please help me to understand this ?
@SQLMaria
@SQLMaria 2 года назад
Mohd, A predicate can be used only once, either as an Acess Predicate or as a Filter Predicate. Although the CUST_ID is listed as an Access Predicate, it is not used because it's not part of the leading edge of the index. It is only used as a Filter Predicate. Unfortunately, the way it's displayed under the execution plan is confusing but when you see the same predicate listed twice, it will be used as described in the second occurrence. In this case, that's as a Filter Predicate.
@atifiu
@atifiu 2 года назад
@@SQLMaria thanks a lot for the explanation. It makes complete sense.
@laurenoe
@laurenoe 2 года назад
Excellent.
@ajaykumargadam8663
@ajaykumargadam8663 2 года назад
Thank you Maria.. Your explanation is awesome always.. __/\__
Далее
Oracle Optimizer Access Methods
10:45
Просмотров 9 тыс.
The five-step guide to SQL tuning | CloudWorld 2022
25:59
The Rise of Oracle, SQL and the Relational Database
22:19
How to Use SQL Plan Baselines and SQL Profiles
55:14
Просмотров 14 тыс.
What Join Types or Join Methods Does Oracle Have?
12:54