[Babase] Queries that run forever
Karl O. Pinc
kop at meme.com
Wed Apr 4 00:37:22 EDT 2007
On 04/03/2007 11:24:01 PM, Tyler Brock wrote:
> Ok, so I'm still trying to figure out why the following query runs
> forever:
>
> delete from rnktypes where rnktype = 'ADFFIX';
I don't think it's that query. I just tried it and it worked
just fine.
You had an INSERT that was taking a long time to run....
It could be that the INSERT was locking things so the
DELETE could not run....
# ps ax | grep postgres
21655 ? S 0:00 postgres: logger process
21657 ? S 4:28 postgres: writer process
21658 ? S 0:01 postgres: stats buffer process
21659 ? S 0:00 postgres: stats collector process
32605 ? S 1:07 postgres: tjb13 babase_copy 127.0.0.1(39955)
idle
32750 ? R 14:52 postgres: tjb13 babase_copy
172.16.3.10(65437) INSERT
321 ? S 0:00 postgres: tjb13 babase_copy
127.0.0.1(40004) DELETE waiting
391 ? R 5:28 postgres: tjb13 babase_copy
172.16.3.10(65493) INSERT
470 ? R 1:02 postgres: tjb13 babase_copy
172.16.3.10(65505) INSERT
495 ? S 0:00 postgres: kop babase_copy 127.0.0.1(40011)
idle in transaction
504 pts/1 S+ 0:00 grep postgres
(For that matter I've got a transaction going that might somehow
possibly be interfering. I'll see if I can find what's doing that
and end the transaction.)
Try using EXPLAIN ANALYZE on your query in psql
http://www.postgresql.org/docs/8.1/static/sql-explain.html
(Which might not help you much but will tell me where
it's slow.)
Karl <kop at meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
More information about the Babase
mailing list