Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: two memory-...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 20 of 21 Topic 4044 of 4361
Post > Topic >>

Re: two memory-consuming postgres processes

by matthew@[EMAIL PROTECTED] (Matthew Wakeling) May 3, 2008 at 10:25 AM

On Fri, 2 May 2008, PFC wrote:
> CREATE TABLE derived AS SELECT ... FROM ... (perform all your derived 
> calculations here)

Given what you have said (that you really want all the data in one table) 
it may be best to proceed like this:

First, take your original table, create an index on the primary key field,

and CLUSTER on that index.

CREATE TABLE derived AS SELECT ... FROM ... ORDER BY primary key field
CREATE INDEX derived_pk ON derived(primary key field)

Repeat those last two commands ad nauseum.

Then, when you want a final full table, run:

CREATE TABLE new_original AS SELECT * FROM original, derived, derived2,
       ... WHERE original.pk = derived.pk ...

That should be a merge join, which should run really quickly, and you can 
then create all the indexes you want on it.

Matthew

-- 
When I first started working with sendmail, I was convinced that the cf
file had been created by someone ba****ng their head on the keyboard. After
a week, I realised this was, indeed, almost certainly the case.
        -- Unknown

-- 
Sent via pgsql-performance mailing list (pgsql-performance@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
 




 21 Posts in Topic:
two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 12:24:35 
Re: two memory-consuming postgres processes
scott.marlowe@[EMAIL PROT  2008-05-02 13:30:38 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 12:38:37 
Re: two memory-consuming postgres processes
scott.marlowe@[EMAIL PROT  2008-05-02 13:53:56 
Re: two memory-consuming postgres processes
tgl@[EMAIL PROTECTED] (T  2008-05-02 16:13:37 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 13:26:47 
Re: two memory-consuming postgres processes
gsmith@[EMAIL PROTECTED]   2008-05-02 16:22:29 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 13:28:42 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 13:35:32 
Re: two memory-consuming postgres processes
scott.marlowe@[EMAIL PROT  2008-05-02 14:40:51 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 13:51:44 
Re: two memory-consuming postgres processes
craig_james@[EMAIL PROTEC  2008-05-02 14:02:24 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 14:09:52 
Re: two memory-consuming postgres processes
lists@[EMAIL PROTECTED]   2008-05-02 23:30:44 
Re: two memory-consuming postgres processes
gsmith@[EMAIL PROTECTED]   2008-05-02 17:23:45 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 14:30:17 
Re: two memory-consuming postgres processes
Kevin.Grittner@[EMAIL PRO  2008-05-02 16:43:58 
Re: two memory-consuming postgres processes
deliverable@[EMAIL PROTEC  2008-05-02 15:03:12 
Re: two memory-consuming postgres processes
Kevin.Grittner@[EMAIL PRO  2008-05-02 17:29:00 
Re: two memory-consuming postgres processes
matthew@[EMAIL PROTECTED]  2008-05-03 10:25:28 
Re: two memory-consuming postgres processes
mmoncure@[EMAIL PROTECTED  2008-05-03 11:07:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 21:00:15 CDT 2008.