Re: [GENERAL] Deletes and large tables

2005-06-10 Thread Edmund Dengler
Just did a sanity check. I dumped the DB schema, and there is indeed a foreign key reference into the table. Now interestingly, the table pointing in has no index on the column, but is a relatively small table with only entries near the end of the large table. So looks like I was getting CPU bound

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread Tom Lane
Edmund Dengler <[EMAIL PROTECTED]> writes: > This table has 3 foreign keys, but that should not matter during deletes. Richard was inquiring about foreign keys linking *into* this table, not out of it. In particular, foreign keys that don't have indexes on the referencing columns; those will incu

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread David Gagnon
This table has 3 foreign keys, but that should not matter during deletes. In addition, the tables being referred to are small, and should be in cache. I'm talking about FK that point this table... Not FK defined for this table that point to other table. If Table A is referenced by 10 other

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread Edmund Dengler
Greetings! This table has 3 foreign keys, but that should not matter during deletes. In addition, the tables being referred to are small, and should be in cache. There are no tables depending on it for references, so no dependent triggers should be running. Also, if this was a foreign key issue,

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread Richard Huxton
Edmund Dengler wrote: Greetings! We have a table with more than 250 million rows. I am trying to delete the first 100,000 rows (based on a bigint primary key), and I had to cancel after 4 hours of the system not actually finishing the delete. I wrote a script to delete individual rows 10,000 at

Re: [GENERAL] Deletes and large tables

2005-06-10 Thread David Gagnon
Hi, You have any foreign keys pointing this table ? That's the problem I got when I wanted to delete all rows from a table with 5 FK. You may search my name in the list archive and found the thread on this matter. Ciao /David Edmund Dengler wrote: Greetings! We have a table with more

[GENERAL] Deletes and large tables

2005-06-10 Thread Edmund Dengler
Greetings! We have a table with more than 250 million rows. I am trying to delete the first 100,000 rows (based on a bigint primary key), and I had to cancel after 4 hours of the system not actually finishing the delete. I wrote a script to delete individual rows 10,000 at a time using transaction