Re: Hash partitioning.

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Claudio Freire <klaussfreire(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Yuri Levinsky <yuril(at)celltick(dot)com>, PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Hash partitioning.
Date: 2013-06-26 12:52:17
Message-ID: 20130626125217.GA3341@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 25, 2013 at 02:52:33PM -0700, Kevin Grittner wrote:
> Claudio Freire <klaussfreire(at)gmail(dot)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 <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2013-06-26 13:14:07 Re: Kudos for Reviewers -- straw poll
Previous Message Atri Sharma 2013-06-26 12:35:32 Re: A better way than tweaking NTUP_PER_BUCKET