Discussion:
[Fwd: Re: RHDB just sits and does nothing?]
(too old to reply)
Scott Marlowe
2004-06-09 13:01:51 UTC
Permalink
Hi,
What an earth I am doing wrong? I am trying to delete about 6500 rows and
I am the only user connected to the database and it just sits there and
does nothing?
Jun 9 10:02:44 pihsi postgres[31547]: [25] LOG: query: begin;
Jun 9 10:02:44 pihsi postgres[31547]: [26] LOG: duration: 0.000181 sec
Jun 9 10:02:51 pihsi postgres[31547]: [27] LOG: query: set constraints
all deferred;
Jun 9 10:02:51 pihsi postgres[31547]: [28] LOG: duration: 0.000205 sec
Jun 9 10:03:04 pihsi postgres[31547]: [29] LOG: query: delete from
tilikartta
where yritys=18231413;
and after a long wait...
Jun 9 10:46:16 pihsi postgres[31547]: [30] LOG: duration: 2592.534609
sec Jun 9 11:00:28 pihsi postgres[31547]: [31] LOG: query: commit;
Jun 9 11:00:28 pihsi postgres[31547]: [32] LOG: duration: 0.002915 sec
DELETE 6347
rahaks=# commit;
COMMIT
It just took about three quarters of a hour to delete 6500 rows!
Something is definitely broken and probably I am the one who broke it. Any
guesses what I have broken and how I could fix this?
Do you have any foreign key references that are of mismatched types
involved?


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html
Tom Lane
2004-06-09 13:46:41 UTC
Permalink
Post by Scott Marlowe
It just took about three quarters of a hour to delete 6500 rows!
Do you have any foreign key references that are of mismatched types
involved?
Specifically, what other tables reference this one? Are their
referencing columns of identical types, and *do they have indexes*?

I'm betting on lack of index myself; that's the only FK mistake that
hurts you only at primary-key-delete time.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
Loading...