4 ms·
Note that Postgres supports functional indexes, and the case in the post (a `lower(column)=`-clause not being able to utilise the column's index) is the example
by brasetvik 9y ago
Note that Postgres supports functional indexes, and the case in the post (a `lower(column)=`-clause not being able to utilise the column's index) is the example used in the documentation: https://www.postgresql.org/docs/current/static/indexes-expressional.html https://www.postgresql.org/docs/current/static/indexes-expre...
- brightball 9y agoWas coming here to post that. Being able to create indexes based on the results of a function is the solution to so many problems. You can even index the result of an XPath function on a huge, compressed XML document.
- jaggederest 9y agoPartial functional indexes are amazing. You can create an index that not only elides execution of the function, but automatically only includes the subset where that function would be relevant. Makes the index smaller, to boot. create index repo_name_lower on repos(LOWER(name)) where name IS NOT NULL;
- combatentropy 9y agoPartial unique-constraint indexes are useful too