BUG #14173: Not using partitions with ANY(ARRAY[...])

From: furstenheim(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14173: Not using partitions with ANY(ARRAY[...])
Date: 2016-06-03 10:37:44
Message-ID: 20160603103744.30386.59358@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14173
Logged by: Gabriel f
Email address: furstenheim(at)gmail(dot)com
PostgreSQL version: 9.5.2
Operating system: Ubuntu 64bit
Description:

http://stackoverflow.com/questions/34766671/how-to-query-against-several-tables-from-a-partition-in-postgresql

I'm querying a table partitioned wrt to some variable, say mvar. If I do:

explain select * from mtable where mvar = 'a' or mvar = 'b'

then the query planner goes only into the two subtables related to 'a' and
'b'.
The same works with the static in

select * from mtable where mvar IN ('a', 'b')

However, it does not work if I use array

select * from mtable where mvar = ANY(ARRAY['a','b'])

the query planner schedules all subtables of the partition.

I've seen the error both in 9.4 and in 9.5.2. However, according to some
comment in the provided link it did work properly with 9.3

Thanks

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message andrew 2016-06-03 12:46:28 BUG #14174: Expanded-datum bug accessing freed memory
Previous Message Timofei Dynikov 2016-06-03 10:09:11 Re: BUG #14171: Wrong FSM file after switching hot standby to master