pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: fatih ozturk <ozturkfa@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: Re: Partitionin with check functions
Date: Tue, 31 Mar 2009 04:07:08 -0700 (PDT)
Message-ID: <397285.75133.qm@web111503.mail.gq1.yahoo.com> (raw)

Thank you

"Yes, it does.  It might be worthwile to use

  WHERE sel=123 AND mod(sel,6)=3

I think you could use a rule to add the mod() condition automatically.
"
this is great idea 

But the problem is i did not accomplish to find a way to change query like

     partitioning=# select * from mainlog where sel=22;

to
    
     partitioning=# select * from mainlog where sel=22 and mod(sel,6)=4;


"on select" rules just creates views, dont routes the queries. 
I cant use tirggers for selects.
Is there exists a way of changing select query before query plan generated?

Any ideas?

I am very appreciative for your answers and interest.

Thanks

--- On Mon, 3/30/09, Harald Fuchs <hari.fuchs@gmail.com> wrote:

From: Harald Fuchs <hari.fuchs@gmail.com>
Subject: Re: [ADMIN] Partitionin with check functions
To: pgsql-admin@postgresql.org
Date: Monday, March 30, 2009, 4:08 PM

In article <2499.1238420859@sss.pgh.pa.us>,
Tom Lane <tgl@sss.pgh.pa.us> writes:

> In particular, a constraint like "sel=123" is *not* going to lead the
> planner to draw any conclusions about the value of "mod(sel,6)".
> Now, if you'd written "WHERE mod(sel,6)=3", I think it would draw
> the right conclusions.

Yes, it does.  It might be worthwile to use

  WHERE sel=123 AND mod(sel,6)=3

I think you could use a rule to add the mod() condition automatically.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



      

view thread (4+ messages)

Message-ID: <397285.75133.qm@web111503.mail.gq1.yahoo.com>
Permalink:  ../397285.75133.qm@web111503.mail.gq1.yahoo.com/
Also on:    postgresql.org/message-id/397285.75133.qm@web111503.mail.gq1.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ozturkfa@yahoo.com
  Subject: Re: Partitionin with check functions
  In-Reply-To: <397285.75133.qm@web111503.mail.gq1.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox