Re: BUG #4418: Memory leak in query planner

From: Michael McMaster <email(at)michaelmcmaster(dot)name>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: michael McMaster <Michael(dot)McMaster(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4418: Memory leak in query planner
Date: 2008-09-16 20:23:48
Message-ID: 48D015D4.4070008@michaelmcmaster.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> "michael McMaster" <Michael(dot)McMaster(at)gmail(dot)com> writes:
>> I intend on creating a view over a large number of tables (possibly > 1000).
>
> Better rethink that plan ... PG's current partitioning support doesn't
> scale that high, and filing bugs claiming it's a memory leak isn't
> going to make it do so.
>
> regards, tom lane
>

I modified the views to mimic the CHECK constraints on the partitioned
tables.
ie CREATE VIEW a_view AS select * from a_table where dtstart between <x>
and <y>
UNION ALL ...

The query plans generated weren't quite as good, but use an
insignificant amount of memory, and are still reasonably fast. This
solution is an acceptable trade off at the moment.

I still think the memory usage issue is a bug, as there are alternative
plans that show Postgres -does- scale that high. I had a quick look
through the code and I suspect that table inheritance wouldn't have this
issue. I'll test inheritance and report my findings.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Legistrate 2008-09-17 03:28:19 BUG #4420: Problem Finding unique text entries
Previous Message Jeff Davis 2008-09-16 18:12:31 Re: BUG #4418: Memory leak in query planner