Search Postgresql Archives

index behavior question - multicolumn not consulted ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have a table with over 1MM records and 15 columns.

I had created a "unique index" on a mix of two columns to enforce a constraint : (resource_type_id, lower(archive_pathname))

i've noticed that searches never use this.  no matter what I query, even if it's only the columns in the index.  I'm seeing a 550ms sequential scan on everything.

If I create an index only on the text field: lower(archive_pathname) , all the queries use that and complete in 1.4ms

does anyone know why this happens ?

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux