Re: BUG #4418: Memory leak in query planner - Mailing list pgsql-bugs

From Michael McMaster
Subject Re: BUG #4418: Memory leak in query planner
Date
Msg-id 48D015D4.4070008@michaelmcmaster.name
Whole thread Raw
In response to Re: BUG #4418: Memory leak in query planner  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom Lane wrote:
> "michael McMaster" <Michael.McMaster@gmail.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.

pgsql-bugs by date:

Previous
From: Jeff Davis
Date:
Subject: Re: BUG #4418: Memory leak in query planner
Next
From: "Legistrate"
Date:
Subject: BUG #4420: Problem Finding unique text entries