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)
"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
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
"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
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