Re: questions about very large table and partitioning

From: Erik Jones <erik(at)myemma(dot)com>
To: fdu(dot)xiaojf(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: questions about very large table and partitioning
Date: 2008-02-19 15:30:12
Message-ID: 56EF3DCA-83CB-46BC-9CF7-006B88AFF180@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Feb 19, 2008, at 7:46 AM, fdu(dot)xiaojf(at)gmail(dot)com wrote:

> I have tried to do partition with inheritance and rules. First, I
> created master table and many child table, and also the rules for
> insert, delete and update. Then I do some select, insert, delete
> and update operations on the master to test if it works. However,
> the insert an delete work very well, but the update operation seems
> never return. I tried several times, and could wait it to return
> and killed the process.
>
> I tried the commands manually, and it seemed very weird.
> The delete command:
> DELETE FROM master_table WHERE id='9999' AND data_type='aaa'
> and select command with the same condition expression:
> SELECT * FROM master_table WHERE id='9999' AND data_type='aaa'
> both return without delay.
> But the update command with the same condition expression:
> UPDATE master_table set data_value='somevalue' WHERE id='9999' AND
> data_type='aaa'
> didn't return in 5 minutes.
>
> Every table has index and constraint on column "id". I have already
> set constraint_exclusion=true.
>
> Why the update command runs so slow ?

You'll need to post some of your tables' schemas along with the
results of running your queries through EXPLAIN or EXPLAIN ANALYZE
(better) in order for anyone to answer that.

Erik Jones

DBA | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message HHB 2008-02-19 15:43:09 Using sequences in SQL text files
Previous Message Joe Conway 2008-02-19 15:04:37 Re: dynamic crosstab