Very slow updates when using IN syntax subselect
| От | Bryce Nesbitt |
|---|---|
| Тема | Very slow updates when using IN syntax subselect |
| Дата | |
| Msg-id | 43ECFF0B.80905@obviously.com обсуждение исходный текст |
| Ответы |
Re: Very slow updates when using IN syntax subselect
|
| Список | pgsql-sql |
If I do: select event_id from event join token using (token_number) where token_status=50 and
reconciled=false limit 1;
Then: update event set reconciled=true where event_id={XXX};
It returns in about a second, or less. But If I do the same thing with
the IN syntax:
update event set reconciled=true where event_id in (select event_id from event join token using (token_number)
wheretoken_status=50 and reconciled=false LIMIT 1);
On a 4 CPU machine, 2 CPU's peg at 100%, and the request just eats CPU
forever. Any clues what might be going on? Help would be much
appreciated. I'm not seeing this on all my DB's... just the important ones.
PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3
20030502 (Red Hat Linux 3.2.3-20)
В списке pgsql-sql по дате отправления: