Re: Automating Partitions in PostgreSQL - Query on syntax

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zeugswetter Andreas OSB sIT <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "vacuum(at)quantentunnel(dot)de" <vacuum(at)quantentunnel(dot)de>, Csaba Nagy <nagy(at)ecircle-ag(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "stark(at)enterprisedb(dot)com" <stark(at)enterprisedb(dot)com>, "kedar(dot)potdar(at)gmail(dot)com" <kedar(dot)potdar(at)gmail(dot)com>
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax
Date: 2009-04-22 15:34:46
Message-ID: 3916.1240414486@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zeugswetter Andreas OSB sIT <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at> writes:
>> Which leads me to the same conclusion: anything as complicated as CASE
>> is the wrong design. But perhaps for slightly different reasons.

> What I like about the sql CASE is, that it is expression based, and thus
> allows full flexibility in partitioning and is highly self documenting.

> Do we need to invent special syntax, or could we use common syntax and
> detect specific use cases and handle them specially ?

The problem with that approach is you still need to have an
implementation for the non-specific cases. What I want is to design
the syntax so that *only* the optimized special cases are possible.
We should not waste time either on implementing the general case or
on constantly re-deducing which special case applies. That's the
Achilles heel of what we have now (ie, constraint exclusion via theorem
proving) --- it's a beautifully general approach, but it's so general
that it's hard to make any but the simplest cases work efficiently, and
the runtime cost of proving *each time* that a special case applies is
horrid.

The KISS principle applies with a vengeance here. I think we should
make the partitioning stuff handle only the simplest cases but do those
well. Anybody who wants something more complex can still try to tackle
it via the existing facilities.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-04-22 15:52:28 Re: Automating Partitions in PostgreSQL - Query on syntax
Previous Message Robert Campbell 2009-04-22 15:29:40 Re: Workaround for bug #4608?