Search Postgresql Archives

Re: Question about index usage

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

 



Guido Neitzer <guido.neitzer@xxxxxxxxxxxxx> writes:
> Is there a reason why this query:
> select id from dga_dienstleister where plz in ('45257', '45259');
> doesn't use this index:
>      "dga_dienstleister_plz_index" btree (plz varchar_pattern_ops)
> but uses this index:
>      "dga_dienstleister_plz_index2" btree (plz)

Because IN means "=", which is a member of the index opclass for the
second index but not the first.

Why do you care?  Should be about the same result either way.

			regards, tom lane


[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