Message 27450

Author
jcavallo
Date
2016-07-29.11:41:06
Message id
27450

Content

They may be useful in some cases, I just wanted to point out that in the
particular case you gave they do not.

See http://dba.stackexchange.com/questions/27481/is-a-composite-index-also-good-for-queries-on-the-first-field
and http://dba.stackexchange.com/questions/6115/working-of-indexes-in-postgresql

The scheduler will use the composite index for the first column and it
will be as efficient as having an extra index only on this column.
This allows to create less indexes and save some space :)

Regarding the reverse, I agree it should not be a rule, but IMHO in
90-95% of the case it should be set. Even on small tables, where the
cost of adding the index is minimal.

For active / company, I think they are not often used since those are
not very discriminative columns. Usually there is only one company,
and almost all records are active...
History
Date User Action Args
2016-07-29 11:41:06jcavallosetmessageid: <1469785266.67.0.0494458666382.issue5757@tryton.org>
2016-07-29 11:41:06jcavallosetrecipients: + ced, albertca, pokoli
2016-07-29 11:41:06jcavallolinkissue5757 messages
2016-07-29 11:41:06jcavallocreate

Showing 10 items. Show all history (warning: this could be VERY long)