pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedToo much time to delete 19000 rows
3+ messages / 3 participants
[nested] [flat]
* Too much time to delete 19000 rows
@ 2006-10-06 18:10 Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2006-10-06 18:26 ` Re: Too much time to delete 19000 rows Andrew Sullivan <ajs@crankycanuck.ca>
2006-10-06 18:27 ` Re: Too much time to delete 19000 rows Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: Ezequias Rodrigues da Rocha @ 2006-10-06 18:10 UTC (permalink / raw)
To: pgsql-sql
Hi list,
I am having many problems to delete a table with only 19000 rows.
The selection takes less than 1 second but on delete I wait more than 4
minutes and notthing. Can someone tell me what could happen ?
I tryed only one transaction but it does not work too:
BEGIN WORK;
delete from base.ticket where session_id = 17 and cash_id = 99 and promo_id = 5;
COMMIT WORK;
I just think it could be occuring becouse of many constraints (7 at all)
Please any help is welcomed.
Regards
Ezequias
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Too much time to delete 19000 rows
2006-10-06 18:10 Too much time to delete 19000 rows Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
@ 2006-10-06 18:26 ` Andrew Sullivan <ajs@crankycanuck.ca>
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Sullivan @ 2006-10-06 18:26 UTC (permalink / raw)
To: pgsql-sql
On Fri, Oct 06, 2006 at 03:10:01PM -0300, Ezequias Rodrigues da Rocha wrote:
>
> BEGIN WORK;
> delete from base.ticket where session_id = 17 and cash_id = 99 and promo_id
> = 5;
> COMMIT WORK;
Try putting EXPLAIN ANALYSE on the beginning to see what's going on.
That said. . .
> I just think it could be occuring becouse of many constraints (7 at all)
. . .it could be, yes. Are all the other tables &c. indexed
correctly? VACUUMed and ANALYSEd?
A
--
Andrew Sullivan | ajs@crankycanuck.ca
The whole tendency of modern prose is away from concreteness.
--George Orwell
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Too much time to delete 19000 rows
2006-10-06 18:10 Too much time to delete 19000 rows Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
@ 2006-10-06 18:27 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2006-10-06 18:27 UTC (permalink / raw)
To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: pgsql-sql
"Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.com> writes:
> The selection takes less than 1 second but on delete I wait more than 4
> minutes and notthing. Can someone tell me what could happen ?
Perhaps foreign keys referencing this table and no indexes on the
referencing columns? You're not required to have an index on the
referencing side, but you pay for it when you update or delete in
the master table...
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-10-06 18:27 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-10-06 18:10 Too much time to delete 19000 rows Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2006-10-06 18:26 ` Andrew Sullivan <ajs@crankycanuck.ca>
2006-10-06 18:27 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox