Re: Composite index - selecting components and order
> Are you saying that composite indexes with more than one item in them are a bad thing?
No, not saying composite indexes would be bad.
Rather, I am saying they may not be beneficial for that SELECT.
> I was of the impression that you wanted many items from your WHERE clause,
Many items that are tested via "=", then one more item.
> in the order they appear in the WHERE, for optimum performance
The order in the WHERE clause is irrelevant.
Max/min requires a GROUP BY (unless you just want a max/min over the whole table).
The ORDER BY may be useful after the GROUP BY.
The syntax of the SELECT statement mirrors the order in which the operations are done:
WHERE (filtering)
GROUP BY (to trigger aggregation)
HAVING (kinda like a WHERE for aggregations)
ORDER BY (sorting the final result)
LIMIT (stopping short)
> The suggestion that indexes should only have 2 items in them would make for totally different schema design choices.
I don't understand what you are saying there. The SELECT determines what indexes would be useful.
Subject
Views
Written By
Posted
2393
May 04, 2013 10:54AM
1062
May 06, 2013 10:47PM
1070
May 07, 2013 08:05PM
1010
May 08, 2013 06:55AM
Re: Composite index - selecting components and order
865
May 08, 2013 08:45PM
1536
May 09, 2013 10:46PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.