Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id A2FB5634E7C for ; Tue, 31 Mar 2009 08:07:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 80215-08 for ; Tue, 31 Mar 2009 08:07:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web111503.mail.gq1.yahoo.com (web111503.mail.gq1.yahoo.com [67.195.15.145]) by mail.postgresql.org (Postfix) with SMTP id A1F7A634C3F for ; Tue, 31 Mar 2009 08:07:12 -0300 (ADT) Received: (qmail 75367 invoked by uid 60001); 31 Mar 2009 11:07:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1238497628; bh=MfdujVrD7ICar6opZ5sIMR+9GkeuUaTNUGcKTeCXTCY=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=JmZ44k+54U9FJZ0nxw7J+DB8sBroK18kayh3KuFoYbGEfyHyF7hRgmhq2A6ecGQx2uACPXc2CgsTX2Ic3RxSmvtzgRGt48RYVroBoNkx6Wex/L3s+jOdCrtnZcHWELhbTcdKSJLJjvDC0ZaYT66Hzj0N45OvK6pUFNjEPC5jqrw= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=A3xSf+9e85lmMcqHdAhvZHdE5GcP1YGEarJJjCWJ6s9ZPki2rA9qEAgJ7OlmuUVaBPshcl5CxQ4CeKdQuQ2ZERkvW/JQVDS8Jx7yp8DhiK5eILpjqIKrYIyLRTPObR6Cl44IkqKIhXim3jJ7YhnMvT7CTzt9eYGWggHlHg/DOfY=; Message-ID: <397285.75133.qm@web111503.mail.gq1.yahoo.com> X-YMail-OSG: I8PqzkoVM1kBVbrO0.n2pJfm6pt0LJlor6n_svGFpE4tybkc88ssrRpbi4c2NbsKKUvNc2yb3CfxCMJmGj6lCCYGEtbFlGNfsLeSSJdDrEh.GHKNoP0VakrLTnK2xumb_jKh3row0C.Qj3edH_ctf0gOXxFey65EWPTeGwKnsZn_cJD4.RuIOtlRUrAgCIktXBarp_dqCignlTkbwX6TRyyfBV_1_evmzXOMMy2uE1K5oAKpptiv9b5QuEm55ddikUda.GalaANBA4mJ1SrlhkmAzsuhRmgW3U8jMecfWyddWNowgTRXEDWDK0Lo_sw9RFzp897uQ3ewaCTs.E82uIOR Received: from [195.175.16.46] by web111503.mail.gq1.yahoo.com via HTTP; Tue, 31 Mar 2009 04:07:08 PDT X-Mailer: YahooMailClassic/5.1.20 YahooMailWebService/0.7.289.1 Date: Tue, 31 Mar 2009 04:07:08 -0700 (PDT) From: fatih ozturk Subject: Re: Partitionin with check functions To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-847384740-1238497628=:75133" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.527 tagged_above=0 required=5 tests=AWL=0.116, HTML_MESSAGE=0.001, SUBJECT_FUZZY_TION=0.41 X-Spam-Level: X-Archive-Number: 200903/258 X-Sequence-Number: 31758 --0-847384740-1238497628=:75133 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thank you "Yes, it does.=A0 It might be worthwile to use =A0 WHERE sel=3D123 AND mod(sel,6)=3D3 I think you could use a rule to add the mod() condition automatically. " this is great idea=20 But the problem is i did not accomplish to find a way to change query like =A0=A0=A0=A0 partitioning=3D# select * from mainlog where sel=3D22; to =A0=A0=A0=20 =A0=A0=A0=A0 partitioning=3D# select * from mainlog where sel=3D22 and mod(= sel,6)=3D4; "on select" rules just creates views, dont routes the queries.=20 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 wrote: From: Harald Fuchs 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 writes: > In particular, a constraint like "sel=3D123" 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)=3D3", I think it would draw > the right conclusions. Yes, it does.=A0 It might be worthwile to use =A0 WHERE sel=3D123 AND mod(sel,6)=3D3 I think you could use a rule to add the mod() condition automatically. --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin =0A=0A=0A --0-847384740-1238497628=:75133 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
=0A=0A --0-847384740-1238497628=:75133--
Thank you

"Yes, it does.  It migh= t be worthwile to use

  WHERE sel=3D123 AND mod(sel,6)=3D3
<= br>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 t= o find a way to change query like

     partition= ing=3D# select * from mainlog where sel=3D22;

to
  &nbs= p;
     partitioning=3D# select * from mainlog wher= e sel=3D22 and mod(sel,6)=3D4;


"on select" rules just creates vi= ews, dont routes the queries.
I cant use tirggers for selects.
Is th= ere exists a way of changing select query before query plan generated?
<= br>Any ideas?

I am very appreciative for your answers and interest.<= br>
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
Dat= e: Monday, March 30, 2009, 4:08 PM

In artic= le <2499.1238420859@sss.pgh.pa.us&g= t;,
Tom Lane <tgl@sss.pgh.pa.us> writes:

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

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

  WHERE sel=3D123 AND mod(sel,6)=3D3

I think you co= uld use a rule to add the mod() condition automatically.


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