On 07.03.2006, at 16:04 Uhr, Tom Lane wrote:
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.
Only because I haven't set up the second index because I wasn't aware
of this fact.
Guido Neitzer <[EMAIL PROTECTED]> 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_index
On 07.03.2006, at 12:09 Uhr, chris smith wrote:
Try without the quotes:
select id from dga_dienstleister where plz in (45257, 45259);
Same result, second index is used.
What is the table structure for dga_dienstleister ?
For the relevant column:
plz| chara
On 3/7/06, Guido Neitzer <[EMAIL PROTECTED]> wrote:
> Hi.
>
> 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:
>
>