Paul J Stevens wrote:
Tom Allison wrote:
Does is make sense to add yet another index?
Since postgres performs better with than without, is that in question?
or to ensure that all the userid records are inserted as lowercase only?
That only works if you make damn sure there aren't any reasons for doing
things mixed case. I'm not saying there are any - just that it needs
careful deliberation and a lot of QA testing on a stable branch.
Also, we can never be too certain about the source of the inserted
records. Perhaps a trigger that would force the lower-case could cover
that though.
So: yes, my hunch is you have a case, but only if the trigger is
provided as well.
I think my concern is valid more on tables that experience very high rate of
change. I would hope that you are not changing the information in the
dbmail_users table so rapidly and so frequently that the extra index becomes a
factor in performance.
It probably isn't really an issue until the table contains 10^6 records or more.
And that point it might make sense to create an additional index.
However, in the meantime, it might not make sense to do anything about this
other than to make a footnote for the insanely high volume servers...