On Tue, Jun 25, 2013 at 02:52:33PM -0700, Kevin Grittner wrote: > Claudio Freire <klaussfre...@gmail.com> wrote: > > > Did you try "select * from foo where (a % 16) = (1::int % 16)"? > > I did. Using Robert's hashed partitioning table definitions: > > test=# explain select * from foo where a = 1 and (a % 16) = (1 % 16); > QUERY PLAN > ------------------------------------------------------------ > Append (cost=0.00..31.53 rows=2 width=36) > -> Seq Scan on foo (cost=0.00..0.00 rows=1 width=36) > Filter: ((a = 1) AND ((a % 16) = 1)) > -> Seq Scan on foo1 (cost=0.00..31.53 rows=1 width=36) > Filter: ((a = 1) AND ((a % 16) = 1)) > (5 rows) > > So if you are generating your queries through something capable of > generating that last clause off of the first, this could work. Not
OK, so what is it in our code that requires that? It is a type mismatch? -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers