Which Order Should Columns Go in an Index?: Finding All the Red Sweets Part 4

preview_player
Показать описание
When you create an index on multiple columns there's an important question you need to answer:

In which order should you list the columns?

This video looks at some of the factors you should consider to help answer this question.

============================
The Magic of SQL with Chris Saxon

Copyright © 2015 Oracle and/or its affiliates. Oracle is a registered trademark of Oracle and/or its affiliates. All rights reserved. Other names may be registered trademarks of their respective owners. Oracle disclaims any warranties or representations as to the accuracy or completeness of this recording, demonstration, and/or written materials (the “Materials”). The Materials are provided “as is” without any warranty of any kind, either express or implied, including without limitation warranties or merchantability, fitness for a particular purpose, and non-infringement.
Рекомендации по теме
Комментарии
Автор

this video answers my two questions.
1. how multiple columns index works? scan through the leading index column first and then to the next index column.
2. why is there must be a primary key index? because the index table size is smaller than the content table itself, that said the query can performs better.

Thanks alot!

cyberplayer
Автор

So, A column with low cardinal values should be the leading column in the index?

satyendrar
Автор

How does that compare to two separate indexes; one by color and one by weight?

ParleysWoodedJourney
Автор

Are you going to try to cover index fast full scans (vs. index full scans)? I'm not sure how you'd go about it...

jb