Re: need help with a query

From: Pavel Velikhov <pvelikhov(at)yahoo(dot)com>
To: "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: need help with a query
Date: 2007-10-19 16:11:36
Message-ID: 499575.37238.qm@web56407.mail.re3.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Thanks for you help!

Got a very different query plan this time, with a hash join between links and articles. At least now postgres is using both shared memory buffers and working mem, but its still completely IO bound, only getting in 5-6% CPU once in a while. I guess I can't squeeze more out of the laptop, but I also have a machine with 16GB RAM that I'll try this on next. Should I allocate tons of memory into shared buffers or into the working memory?

Thanks in advance!

----- Original Message ----
From: Jonah H. Harris <jonah(dot)harris(at)gmail(dot)com>
To: Pavel Velikhov <pvelikhov(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Sent: Friday, October 19, 2007 7:52:58 PM
Subject: Re: [PERFORM] need help with a query

On 10/19/07, Pavel Velikhov <pvelikhov(at)yahoo(dot)com> wrote:
>
> Hi,
>
> I am updating a big table (90M records) with data from another
rather
> large table (4M entries). Here is my update query:
>
> update links set target_size =
> ( select size from articles where articles.article_id =
> links.article_to)

try:

UPDATE links
SET target_size = size
FROM articles
WHERE articles.article_id = links.article_to;

--
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
499 Thornall Street, 2nd Floor | jonah(dot)harris(at)enterprisedb(dot)com
Edison, NJ 08837 | http://www.enterprisedb.com/

---------------------------(end of
broadcast)---------------------------
TIP 6: explain analyze is your friend

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2007-10-19 16:34:01 Re: need help with a query
Previous Message Jonah H. Harris 2007-10-19 15:52:58 Re: need help with a query