Index usage for BYTEA column in OR/IN clause - Mailing list pgsql-general

From David Garamond
Subject Index usage for BYTEA column in OR/IN clause
Date
Msg-id 4065953D.2050708@zara.6.isreserved.com
Whole thread Raw
Responses Re: Index usage for BYTEA column in OR/IN clause
Re: Index usage for BYTEA column in OR/IN clause
List pgsql-general
Is it true that the planner currently doesn't utilize index for BYTEA
column in OR or IN clause?

  -- b is an indexed BYTEA column

  explain select * from t where b='foo';                    -- index scan
  explain select * from t where b like 'f%';                -- index

  explain select * from t where b='foo' or b='bar';         -- seq scan
  explain select * from t where b='foo' or b like 'b%';     -- seq
  explain select * from t where b like 'f%' or b like 'b%'; -- seq
  explain select * from t where b in ('foo','bar');         -- seq

Currently I'm setting enable_seqscan to off for these...

--
dave

pgsql-general by date:

Previous
From: Richard Welty
Date:
Subject: Re: Physical Database Configuration
Next
From: weiping he
Date:
Subject: Re: Native Win32 port - PLEASE!