Re: partitioning using dblink

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Scara Maccai" <m_lists(at)yahoo(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: partitioning using dblink
Date: 2008-02-29 17:07:14
Message-ID: e51f66da0802290907m5c3ff38bk1724ba564efce3a2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/29/08, Scara Maccai <m_lists(at)yahoo(dot)it> wrote:
> I'm sorry, I didn't understand you post...
>
> 1) Why does my current implementation is not working? Hierarchy doesn't work with views in general, not only with dblink

Exactly, because inheritance/constraint exclusion wont work with views.

> 2) Why am I supposed to use unions in the view?

So that query evaluator can exclude unnecessary partitions.

Given view:

create view.. as
select * from blah() where id >= 0 and id < 10000
union all
select * from blah() where id >= 10000 and id < 20000
...

Then running query

select * from view where id = 10;

can skip partitions by simply examining where expression.

Quite likely you need to tune it for your case.

> 3) I know that I am doing select * from tbl in the remote db; that is something I can work on later.
> At least I would like to see it working, since there is nothing in the docs that says it shouldn't be working...
> 4) I am not able to rewrite my queries.

Have fun then.

--
marko

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Bowlby 2008-02-29 17:09:02 issue with an assembled date field
Previous Message Tom Lane 2008-02-29 17:05:43 Re: errors in pg_restore on windows?