where (x, y, z) in ((x1, y1, z1), (x1, y1, z1), (x1, y1, z1), (x2, y2, z2)) (not) optimized

From: Grzegorz Jaśkiewicz <gryzman(at)gmail(dot)com>
To: GENERAL <pgsql-general(at)postgresql(dot)org>
Subject: where (x, y, z) in ((x1, y1, z1), (x1, y1, z1), (x1, y1, z1), (x2, y2, z2)) (not) optimized
Date: 2009-01-26 11:41:21
Message-ID: 2f4958ff0901260341m75f6d08axd4ed2b44d90b70c8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hey folks,

I have question really for all mighty developers, but don't want to
spam -hackers with it.

why :
select * from foo where X in (1,1,1,1,1,1,1,1) --- same values in search.
or select * from foo where (x,y) in ((1,2),(1,2),(1,2),(1,2),(1,2),(1,2),(1,2));

never gets optimized by planner, etc ?

Is it just not worth optimizing from pg side? I am sure, it would make
sense to actually reorder these values, so that index/whatnot could
pick it up faster.

Just another one of those, 'why' (not) questions from my side.

thanks.

--
GJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Phoenix Kiula 2009-01-26 13:09:23 How to do an UPDATE for all the fields that do NOT break a constraint?
Previous Message Scott Marlowe 2009-01-26 07:07:35 Re: Slow first query despite LIMIT and OFFSET clause