Re: need help with a query

Поиск
Список
Период
Сортировка
От Pavel Velikhov
Тема Re: need help with a query
Дата
Msg-id 499575.37238.qm@web56407.mail.re3.yahoo.com
обсуждение исходный текст
Ответ на need help with a query  (Pavel Velikhov <pvelikhov@yahoo.com>)
Ответы Re: need help with a query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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.harris@gmail.com>
To: Pavel Velikhov <pvelikhov@yahoo.com>
Cc: pgsql-performance@postgresql.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@yahoo.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.harris@enterprisedb.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

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: need help with a query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: need help with a query