Re: [PERFORM] slow deletes on pgsql 7.4

2006-04-26 Thread Junaili Lie
It was on my first email. Here it is again: MONSOON=# explain delete from scenario where id='1099';  QUERY PLAN-- Index Scan using scenario_pkey on scenario  (cost= 0.00..3.14 rows=1 width=6)

Re: [PERFORM] slow deletes on pgsql 7.4

2006-04-25 Thread Tom Lane
"Junaili Lie" <[EMAIL PROTECTED]> writes: > ie. delete from scenario where id=3D'1023' is very fast, but delete from > scenario where id=3D'1099' is running forever. What does EXPLAIN show for each of those cases? regards, tom lane ---(end of broad

Re: [PERFORM] slow deletes on pgsql 7.4

2006-04-25 Thread Junaili Lie
hi, Thanks for the answer. I have double checked that all the foreign key that are referencing "id" on scenario are indexed. I have even vacuum analyze scenario table and all the tables that referenced this table. Something that is interesting is that: it only happens for a certain values. ie. del

Re: [PERFORM] slow deletes on pgsql 7.4

2006-04-25 Thread Tom Lane
"Junaili Lie" <[EMAIL PROTECTED]> writes: > we encounter issues when deleting from a table based on id (primary key). O= > n > certain 'id', it took forever to delete and the i/o is 100% busy. Almost always, if delete is slow when selecting the same rows is fast, it's because you've got a trigger

Re: [PERFORM] slow deletes on pgsql 7.4

2006-04-25 Thread Junaili Lie
I should also mention that select ... for update is fast: MONSOON=# begin;explain analyze select * from SCENARIO WHERE id = '1099' FOR UPDATE; BEGIN    QUERY PLAN