Forum OpenACS Q&A: Response to Question about an index

Collapse
Posted by Don Baccus on
Only in cases where your join or restriction clause references both columns or the first (on_which_table) column.  The index won't be used if you're just using on_what_id.

For Oracle, this probably needs to be refined for the "only on_what_id" case.  It won't do a binary search on the index contents, but if the table rows are sufficiently large, it should still do a linear search on the index contents.  In this case there's some savings simply because it
only needs to sweep the smaller index rather than the larger table.