Search Postgresql Archives

Re: Partitioned Database and Choosing Subtables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/16/2011 12:40 AM, Alban Hertroys wrote:
Try using "dynamic" sql:

EXECUTE 'SELECT lions,  tigers, bears, statecode FROM WildLife WHERE
state_pt = ' || statecode INTO ...;
Thanks Igor. It was a nice try -- and I thought it would work, but the Planner had other plans. Basically, I tried the interactive method using a PREPARE statement with one text parammeter followed by an EXECUTE statement. Unfortunately, the query still went rummaging across the entire database sequentially.

That's not the same as using dynamic SQL. In fact, that would behave just like your previous, problematic, query.

Dynamic SQL makes that the planner sees a new query each time, that needs to be planned from scratch.

Thanks for explaining this. I think I can just see what you mean. I can also see that I'm way out of my depth here. It's just so much fun when you mix deadlines with ignorance.

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

Good point. I'm feeling a bit chainsaw-ish right now.

--
*Bill Thoen*
GISnet - www.gisnet.com
303-786-9961

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux