Re: Inheritance efficiency

Lists: pgsql-general
From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Inheritance efficiency
Date: 2010-04-26 07:39:39
Message-ID: j2k3eff28921004260039m7a50abdan18fe09ca8d043daf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi all.

I'm wondering how efficient the inheritance can be.
I'm using the constraint exclusion feature and for each child table
(maybe but one) I have a proper CHECK constraint.
How efficient can the query planner be in choosing the right child
tables in the case of, say, thousands of them?
Would the selection process behave linearly, logarithmically or what?

And now it comes to my mind the same question for partial indexes.
That is, if I had a lot (really a lot) of small partial indexes over a
very large table, how efficient can the query planner be
in selecting the right indexes?

Will these answers change in v9?

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-26 14:01:44
Message-ID: 201004261401.o3QE1ib24071@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vincenzo Romano wrote:
> Hi all.
>
> I'm wondering how efficient the inheritance can be.
> I'm using the constraint exclusion feature and for each child table
> (maybe but one) I have a proper CHECK constraint.
> How efficient can the query planner be in choosing the right child
> tables in the case of, say, thousands of them?
> Would the selection process behave linearly, logarithmically or what?

It is fine for dozens of child tables, but not thousands; it does need
improvement.

> And now it comes to my mind the same question for partial indexes.
> That is, if I had a lot (really a lot) of small partial indexes over a
> very large table, how efficient can the query planner be
> in selecting the right indexes?
>
> Will these answers change in v9?

No.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-26 15:41:20
Message-ID: u2y3eff28921004260841j90777a6co4267ad8ae4f36aa1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/4/26 Bruce Momjian <bruce(at)momjian(dot)us>:
> Vincenzo Romano wrote:
>> Hi all.
>>
>> I'm wondering how efficient the inheritance can be.
>> I'm using the constraint exclusion feature and for each child table
>> (maybe but one) I have a proper CHECK constraint.
>> How efficient can the query planner be in choosing the right child
>> tables in the case of, say, thousands of them?
>> Would the selection process behave linearly, logarithmically or what?
>
> It is fine for dozens of child tables, but not thousands; it does need
> improvement.

This sounds like "linear" algorithms. Doesn't it?

>> And now it comes to my mind the same question for partial indexes.
>> That is, if I had a lot (really a lot) of small partial indexes over a
>> very large table, how efficient can the query planner be
>> in selecting the right indexes?

No info about this point (partial indexes)?
Is also this geared with linear algorithms ?

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-29 09:29:36
Message-ID: p2q3eff28921004290229v6c7c2420vf863a32e51a95d21@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/4/26 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
> 2010/4/26 Bruce Momjian <bruce(at)momjian(dot)us>:
>> Vincenzo Romano wrote:
>>> Hi all.
>>>
>>> I'm wondering how efficient the inheritance can be.
>>> I'm using the constraint exclusion feature and for each child table
>>> (maybe but one) I have a proper CHECK constraint.
>>> How efficient can the query planner be in choosing the right child
>>> tables in the case of, say, thousands of them?
>>> Would the selection process behave linearly, logarithmically or what?
>>
>> It is fine for dozens of child tables, but not thousands; it does need
>> improvement.
>
> This sounds like "linear" algorithms. Doesn't it?
>
>>> And now it comes to my mind the same question for partial indexes.
>>> That is, if I had a lot (really a lot) of small partial indexes over a
>>> very large table, how efficient can the query planner be
>>> in selecting the right indexes?
>
> No info about this point (partial indexes)?
> Is also this geared with linear algorithms ?

Should I move to an "enterprise grade" version of PostgreSQL?

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS


From: David Fetter <david(at)fetter(dot)org>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 04:48:50
Message-ID: 20100430044850.GA17689@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Thu, Apr 29, 2010 at 11:29:36AM +0200, Vincenzo Romano wrote:
> > No info about this point (partial indexes)?
> > Is also this geared with linear algorithms ?
>
> Should I move to an "enterprise grade" version of PostgreSQL?

The enterprise grade version of PostgreSQL is the community version.

Proprietary forks exist, but they don't fix this kind of problem. :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: David Fetter <david(at)fetter(dot)org>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 06:19:19
Message-ID: z2n3eff28921004292319g78e71742hb29a0f4532d0786a@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/4/30 David Fetter <david(at)fetter(dot)org>:
> On Thu, Apr 29, 2010 at 11:29:36AM +0200, Vincenzo Romano wrote:
>> > No info about this point (partial indexes)?
>> > Is also this geared with linear algorithms ?
>>
>> Should I move to an "enterprise grade" version of PostgreSQL?
>
> The enterprise grade version of PostgreSQL is the community version.
>
> Proprietary forks exist, but they don't fix this kind of problem. :)

Hmmm ... I think this is the kind of problems that keeps PostgreSQL away
from the "enterprise grade" world.
The ability to cope with thousands of DB objects like (child-)tables,
indexes, functions and so on with
O(1) or at least O(log(n)) complexity is among the key points.

For example, the Linux kernel made the big jump with server hardware
thanks also to the O(1) schedulers.

In this specific case, if you think about "inheritance for
partitioning" and you stick with the example idea of "one partition
per month", then the current solution is more than OK.
In the real world, that is not really the general case, especially in
the "enterprise grade" world, where maybe you partition with both a
time stamp and another column, like product code ranges and prefixes
...

Is there any planning about this improvement?

>
> Cheers,
> David.
> --
> David Fetter <david(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
> Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com
> iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>

--
Vincenzo Romano
NotOrAnd Information Technologies
cel. +39 339 8083886 | gtalk. vincenzo(dot)romano(at)notorand(dot)it
fix. +39 0823 454163 | skype. notorand.it
fax. +39 02 700506964 | msn. notorand.it
NON QVIETIS MARIBVS NAVTA PERITVS


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: David Fetter <david(at)fetter(dot)org>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 06:44:26
Message-ID: p2z3eff28921004292344z1b643c2fif7d62e7315a11435@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/4/30 Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>:
> 2010/4/30 David Fetter <david(at)fetter(dot)org>:
>> On Thu, Apr 29, 2010 at 11:29:36AM +0200, Vincenzo Romano wrote:
>>> > No info about this point (partial indexes)?
>>> > Is also this geared with linear algorithms ?
>>>
>>> Should I move to an "enterprise grade" version of PostgreSQL?
>>
>> The enterprise grade version of PostgreSQL is the community version.
>>
>> Proprietary forks exist, but they don't fix this kind of problem. :)
>
> Hmmm ... I think this is the kind of problems that keeps PostgreSQL away
> from the "enterprise grade" world.
> The ability to cope with thousands of DB objects like (child-)tables,
> indexes, functions and so on with
> O(1) or at least O(log(n))  complexity is among the key points.
>
> For example, the Linux kernel made the big jump with server hardware
> thanks also to the O(1) schedulers.
>
> In this specific case, if you think about "inheritance for
> partitioning" and you stick with the example idea of "one partition
> per month", then the current solution is more than OK.
> In the real world, that is not really the general case, especially in
> the "enterprise grade" world, where maybe you partition with both a
> time stamp and another column, like product code ranges and prefixes
> ...
>
> Is there any planning about this improvement?

Could it be possible to just make some changes (adding indexes) to the
information schema
to gain this enterprise gradeness?

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS


From: David Fetter <david(at)fetter(dot)org>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 14:30:44
Message-ID: 20100430143044.GA4279@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, Apr 30, 2010 at 08:44:26AM +0200, Vincenzo Romano wrote:
> >>> Should I move to an "enterprise grade" version of PostgreSQL?
> >>
> >> The enterprise grade version of PostgreSQL is the community
> >> version.
> >>
> >> Proprietary forks exist, but they don't fix this kind of problem.
> >> :)
> >
> > Hmmm ... I think this is the kind of problems that keeps
> > PostgreSQL away from the "enterprise grade" world. The ability to
> > cope with thousands of DB objects like (child-)tables, indexes,
> > functions and so on with O(1) or at least O(log(n))  complexity is
> > among the key points.
> >
> > For example, the Linux kernel made the big jump with server
> > hardware thanks also to the O(1) schedulers.
> >
> > In this specific case, if you think about "inheritance for
> > partitioning" and you stick with the example idea of "one
> > partition per month", then the current solution is more than OK.
> > In the real world, that is not really the general case, especially
> > in the "enterprise grade" world, where maybe you partition with
> > both a time stamp and another column, like product code ranges and
> > prefixes ...
> >
> > Is there any planning about this improvement?
>
> Could it be possible to just make some changes (adding indexes) to
> the information schema to gain this enterprise gradeness?

Your assertion that PostgreSQL is not "enterprise grade" is simply
false. For years, it has been and continues to be used as the basis
of extremely large mission-critical systems.

That said, if you wish to make changes, or propose that some be made,
please feel free to do so after 9.0 comes out.

In the mean time, please test 9.0beta1 along with any ensuing betas
and release candidates, and report back the results of the
aforementioned testing.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 16:07:15
Message-ID: 20100430160714.GB3151@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vincenzo Romano wrote:

> In this specific case, if you think about "inheritance for
> partitioning" and you stick with the example idea of "one partition
> per month", then the current solution is more than OK.
> In the real world, that is not really the general case, especially in
> the "enterprise grade" world, where maybe you partition with both a
> time stamp and another column, like product code ranges and prefixes
> ...
>
> Is there any planning about this improvement?

Of course. People is always looking to make improvements in many areas.
There are very few things that people consider to be "more than OK".
The partitioning features are among those being more examined for
possibly improvements.

This does *not* mean that PostgreSQL doesn't serve mission critical
systems already, on enterprises large and small, some of them on very
large systems. What you see in these lists (people describing
"partition by month" schemes) are not necessarily the most complex
setups out there.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 16:52:11
Message-ID: s2x3eff28921004300952i28259025n85aa2c52f8dba5dc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/4/30 Alvaro Herrera <alvherre(at)commandprompt(dot)com>:
> Vincenzo Romano wrote:
>
>> In this specific case, if you think about "inheritance for
>> partitioning" and you stick with the example idea of "one partition
>> per month", then the current solution is more than OK.
>> In the real world, that is not really the general case, especially in
>> the "enterprise grade" world, where maybe you partition with both a
>> time stamp and another column, like product code ranges and prefixes
>> ...
>>
>> Is there any planning about this improvement?
>
> Of course.  People is always looking to make improvements in many areas.
> There are very few things that people consider to be "more than OK".
> The partitioning features are among those being more examined for
> possibly improvements.
>
> This does *not* mean that PostgreSQL doesn't serve mission critical
> systems already, on enterprises large and small, some of them on very
> large systems.  What you see in these lists (people describing
> "partition by month" schemes) are not necessarily the most complex
> setups out there.

Hi.
I've nerver meant to say that PG is not mission critical!
I argued that O(n) stuff will keep it away from "enterprise grade" applications.
I've been told earlier that "It is fine for dozens of child tables,
but not thousands;
it does need improvement."

This is not enterprise grade.
And the same could go for (a large number of) partial indexes.
Any idea here?

Infact I have in mind also a different approach to partitioning which
could be useful (under certain constraints, of course).
Instead of partitioning the table itself, you can partition the indexes.
The data can still be in a single table (for the sake of some FKs for example).
Just the indexes get "partitioned"·
But, of course, a lot depends on whether the selection of the right indexes
(among thousands) is effective or not.

>
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>

--
Vincenzo Romano
NotOrAnd Information Technologies
cel. +39 339 8083886 | gtalk. vincenzo(dot)romano(at)notorand(dot)it
fix. +39 0823 454163 | skype. notorand.it
fax. +39 02 700506964 | msn. notorand.it
NON QVIETIS MARIBVS NAVTA PERITVS


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 18:13:14
Message-ID: 20100430181314.GE3151@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vincenzo Romano wrote:

> This is not enterprise grade.

"Enterprise grade" is nothing but a buzzword. Oh, it's also a moving
target. We've been not enterprise grade for years, always one feature
behind (and strangely, the one lacking feature is always the one of
interest to the complainant).

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>, David Fetter <david(at)fetter(dot)org>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-04-30 20:48:54
Message-ID: 201004302048.o3UKmsO25945@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Alvaro Herrera wrote:
> Vincenzo Romano wrote:
>
> > This is not enterprise grade.
>
> "Enterprise grade" is nothing but a buzzword. Oh, it's also a moving
> target. We've been not enterprise grade for years, always one feature
> behind (and strangely, the one lacking feature is always the one of
> interest to the complainant).

We do have this enhancement coming in Postgres 9.0:

Add an index on pg_inherits.inhparent, and use it to avoid seqscans
in find_inheritance_children(). This is a complete no-op in databases
without any inheritance. In databases where there are just a few
entries in pg_inherits, it could conceivably be a small loss. However,
in databases with many inheritance parents, it can be a big win.

However, I don't think this going to help a lot for partitioning because
the cost is mostly checking the CHECK constraints, not finding the
table's children.

Like all Postgres missing features, we just need someone with time to
volunteer to research and fix it.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com


From: Alex Hunsaker <badalex(at)gmail(dot)com>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-05-01 02:02:52
Message-ID: v2v34d269d41004301902q5660a4f8m360d4d5c3766744d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, Apr 30, 2010 at 00:19, Vincenzo Romano
<vincenzo(dot)romano(at)notorand(dot)it> wrote:
> For example, the Linux kernel made the big jump with server hardware
> thanks also to the O(1) schedulers.

<flamebait>
Uhh linux has not had a O(1) scheduler since 2.6.23, its supposedly
O(log n) now. =)
</flamebait>


From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-05-01 03:08:22
Message-ID: 4BDB9B26.1090007@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vincenzo Romano wrote:
> I argued that O(n) stuff will keep it away from "enterprise grade" applications.
> I've been told earlier that "It is fine for dozens of child tables,
> but not thousands;
> it does need improvement."
> This is not enterprise grade

Enterprise grade doesn't mean anything. Partitioning designs that
require thousands of child tables to work right are fundamentally
misdesigned anyway, so there is no reason for any of the contributors to
the project to work on improving support for them. There are far too
many obvious improvements that could be made to PostgreSQL, ones that
will benefit vastly more people, to divert resources toward something
you shouldn't be dong anyway like that.

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us


From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance efficiency
Date: 2010-05-01 03:33:09
Message-ID: 4BDBA0F5.4040608@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Greg Smith wrote:
> Enterprise grade doesn't mean anything. Partitioning designs that
> require thousands of child tables to work right are fundamentally
> misdesigned anyway, so there is no reason for any of the contributors
> to the project to work on improving support for them. There are far
> too many obvious improvements that could be made to PostgreSQL, ones
> that will benefit vastly more people, to divert resources toward
> something you shouldn't be dong anyway like that.
>

my sql developer, who's been doing oracle for 15+ years, says postgres'
partitioning is flawed from his perspective because if you have a
prepared statement like..

SELECT fields FROM partitioned_table WHERE primarykey = $1;

it doesn't optimize this very well and ends up looking at all the
sub-table indicies. ir you instead execute the statement

SELECT fields FROM parritioned_table WHERE primarykey = constant;

he says the planner will go straight to the correct partition.

i haven't confirmed this for myself.


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-05-01 05:29:50
Message-ID: t2p3eff28921004302229kf01a478r8626ceee06c4046@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/5/1 Greg Smith <greg(at)2ndquadrant(dot)com>:
> Vincenzo Romano wrote:
>>
>> I argued that O(n) stuff will keep it away from "enterprise grade"
>> applications.
>> I've been told earlier that "It is fine for dozens of child tables,
>> but not thousands;
>> it does need improvement."
>> This is not enterprise grade
>
> Enterprise grade doesn't mean anything.  Partitioning designs that require
> thousands of child tables to work right are fundamentally misdesigned
> anyway, so there is no reason for any of the contributors to the project to
> work on improving support for them.  There are far too many obvious
> improvements that could be made to PostgreSQL, ones that will benefit vastly
> more people, to divert resources toward something you shouldn't be dong
> anyway like that.

While I can agree that "Enterprise grade" is a buzzword, it does mean
something: "very large amount of data" among other.
There's no "fundamentally good design", but only a design which takes
limitations and constraints into account.

I just say that sublinear algorithms allow better handling for growing
numbers of objects.

--
Vincenzo Romano
NotOrAnd Information Technologies
cel. +39 339 8083886 | gtalk. vincenzo(dot)romano(at)notorand(dot)it
fix. +39 0823 454163 | skype. notorand.it
fax. +39 02 700506964 | msn. notorand.it
NON QVIETIS MARIBVS NAVTA PERITVS


From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-05-01 07:00:56
Message-ID: 4BDBD1A8.9020106@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Vincenzo Romano wrote:
> While I can agree that "Enterprise grade" is a buzzword, it does mean
> something: "very large amount of data" among other.
>

http://thedailywtf.com/Articles/Bitten_by_the_Enterprise_Bug.aspx

It's quite straighforward to get PostgreSQL up and running with many
terabytes of data, so long as you respect the design trade-offs in some
options. What you can't do is say those are wrong and reject
alternative implementation suggestions just because they're not
"enterprise". Whenever anyone uses that word at me, I mentally replace
it with "super duper", and

> There's no "fundamentally good design", but only a design which takes
> limitations and constraints into account.
>

You mean like taking into account the fact that partitioning performance
has an unavoidable trade-off, where you have to balance the query
optimizer overhead of supporting many partitions against the improvement
from splitting data into smaller pieces?

--
Greg Smith 2ndQuadrant US Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.us


From: Vincenzo Romano <vincenzo(dot)romano(at)notorand(dot)it>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, David Fetter <david(at)fetter(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inheritance efficiency
Date: 2010-05-01 08:59:27
Message-ID: h2u3eff28921005010159j8c11cfc6t56ed3dc8ea29fa09@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/5/1 Greg Smith <greg(at)2ndquadrant(dot)com>:
> Vincenzo Romano wrote:
>>
>> While I can agree that "Enterprise grade" is a buzzword, it does mean
>> something: "very large amount of data" among other.
>>
>
> http://thedailywtf.com/Articles/Bitten_by_the_Enterprise_Bug.aspx
>
> It's quite straighforward to get PostgreSQL up and running with many
> terabytes of data, so long as you respect the design trade-offs in some
> options.  What you can't do is say those are wrong and reject alternative
> implementation suggestions just because they're not "enterprise".  Whenever
> anyone uses that word at me, I mentally replace it with "super duper", and
>
>> There's no "fundamentally good design", but only a design which takes
>> limitations and constraints into account.
>>
>
> You mean like taking into account the fact that partitioning performance has
> an unavoidable trade-off, where you have to balance the query optimizer
> overhead of supporting many partitions against the improvement from
> splitting data into smaller pieces?

Or taking into account that some parts of the engine are not scalable.
Almost all current RDBMS can cope with terabytes.
Almost none (if any) can cope with large number of partial indexes (provided
they support them) or child tables or table level constraints and so on.
This is a fact as far as I've read so far.

Then we can discuss about the enterprise grade, the fault tolerance
and whatever else
buzzword pops up in our minds.
These ones maybe not.

--
Vincenzo Romano
NotOrAnd Information Technologies
NON QVIETIS MARIBVS NAVTA PERITVS


From: Cédric Villemain <cedric(dot)villemain(dot)debian(at)gmail(dot)com>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance efficiency
Date: 2010-05-01 10:47:36
Message-ID: w2pe94e14cd1005010347wcdc0893akf35500e46918e9c3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

2010/5/1 John R Pierce <pierce(at)hogranch(dot)com>:
> Greg Smith wrote:
>>
>> Enterprise grade doesn't mean anything.  Partitioning designs that require
>> thousands of child tables to work right are fundamentally misdesigned
>> anyway, so there is no reason for any of the contributors to the project to
>> work on improving support for them.  There are far too many obvious
>> improvements that could be made to PostgreSQL, ones that will benefit vastly
>> more people, to divert resources toward something you shouldn't be dong
>> anyway like that.
>>
>
> my sql developer, who's been doing oracle for 15+ years, says postgres'
> partitioning is flawed from his perspective because if you have a prepared
> statement like..
>
>   SELECT fields FROM partitioned_table WHERE primarykey = $1;
>
> it doesn't optimize this very well and ends up looking at all the sub-table
> indicies.   ir you instead execute the statement
>
>   SELECT fields FROM parritioned_table WHERE primarykey = constant;
>
> he says the planner will go straight to the correct partition.
>
> i haven't confirmed this for myself.

It has nothing to do with partitionning but how the planner works.
Even if the use case remain correct....

>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Cédric Villemain


From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: John R Pierce <pierce(at)hogranch(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance efficiency
Date: 2010-05-01 10:56:38
Message-ID: C18666A6-B14F-45D4-BB45-30F93C719279@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 1 May 2010, at 5:33, John R Pierce wrote:

> Greg Smith wrote:
> my sql developer, who's been doing oracle for 15+ years, says postgres' partitioning is flawed from his perspective because if you have a prepared statement like..
>
> SELECT fields FROM partitioned_table WHERE primarykey = $1;
>
> it doesn't optimize this very well and ends up looking at all the sub-table indicies.

Yes it would, for a very logical reason.

A prepared statement is nothing but a stored query plan - its benefits are mostly that you can skip the query planning step before performing a query, which helps queries that are performed very frequently in a short time or that take a long time planning.

But skipping the query planner also has a drawback; the planner has to make a general assumption about what kind of data you'll be querying. It can't vary the query plan depending on what data you're querying for.

If someone is writing a query on a partitioned table and wants to rely on constraint exclusion and they're trying to use a prepared statement then they don't understand what prepared statements are.

You could argue that some logic could be added to the handling of prepared statements to insert query-subplans depending on what data you use for your parameters, but then you're moving back in the direction of unprepared statements (namely invoking the query planner). It would help cases like this one, but it would hurt all other prepared statements. It would at the least add a parse tree back into the queries path, which would be a fairly simplistic one in the case of table partitioning, but would get fairly complex for prepared statements involving more parameters - so much so that the benefit of using a prepared statement (not spending time planning the query) would get reduced significantly.
It's possible that Oracle implemented something like this, but as you see it's not necessarily an improvement.

In practice people either query the correct table partition directly or do not use a prepared statement.

> ir you instead execute the statement
>
> SELECT fields FROM parritioned_table WHERE primarykey = constant;
>
> he says the planner will go straight to the correct partition.
>
> i haven't confirmed this for myself.

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.

!DSPAM:737,4bdc08fc10416246414315!


From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance efficiency
Date: 2010-05-01 11:08:08
Message-ID: 9870F727-ECE9-43F6-8496-666BBAB82343@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On 1 May 2010, at 12:56, Alban Hertroys wrote:

> You could argue that some logic could be added to the handling of prepared statements to insert query-subplans depending on what data you use for your parameters, but then you're moving back in the direction of unprepared statements (namely invoking the query planner). It would help cases like this one, but it would hurt all other prepared statements. It would at the least add a parse tree back into the queries path, which would be a fairly simplistic one in the case of table partitioning, but would get fairly complex for prepared statements involving more parameters - so much so that the benefit of using a prepared statement (not spending time planning the query) would get reduced significantly.

And of course it would add time for planning the query-tree to the creation of the prepared statement - which could be significant compared to the time people expect to save by not invoking the planner on later invocations of the same query. That said, the more frequent the query is executed the less that hurts performance, while it doesn't really matter for queries that are executed infrequently.

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,4bdc0ba010411331128920!