Regression in IN( field, field, field ) performance

From: Jim 'Decibel!' Nasby <jnasby(at)cashnetusa(dot)com>
To: Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Regression in IN( field, field, field ) performance
Date: 2008-10-21 15:45:43
Message-ID: D8ED6CE5-3A4B-496B-A47B-91A0ABF10EFE@cashnetusa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

WHERE '12814474045' IN (people.home_phone, people.work_phone,
people.mobile_phone)

Yeah, not exactly a common case, but at least in 8.1 this was turned
into a set of ORs. Starting in 8.2 and in current HEAD, the planner
turns that into:

Filter: ('12814474045'::text = ANY ((ARRAY[home_phone, mobile_phone,
work_phone])::text[]))

Which means automatic seqscan. Would it be difficult to teach the
planner to handle this case differently? I know it's probably not
terribly common, but it is very useful.
--
Decibel! jnasby(at)cashnetusa(dot)com (512) 569-9461

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2008-10-21 16:04:37 double-buffering page writes
Previous Message David Fetter 2008-10-21 15:45:11 Re: automatic parser generation for ecpg