Hi,
I face the following problem: I have a large table with 12 million addresses,
referenced by 20 other tables (some containing about one million entries).
There are indexes on the foreign keys.
Now I wanted to delete about 10 million addresses (that are not referenced
anymore from
On Tue, Dec 20, 2011 at 3:01 AM, Daniel Migowski dmigow...@ikoffice.de wrote:
DELETE FROM address
WHERE id NOT IN (SELECT address_id FROM bank where address_id IS NOT NULL)
AND id NOT IN (SELECT poboxaddress_id FROM bank where poboxaddress_id IS
NOT NULL)
AND id NOT IN (SELECT
Hello
2011/12/19 Daniel Migowski dmigow...@ikoffice.de:
Hi,
I face the following problem: I have a large table with 12 million
addresses, referenced by 20 other tables (some containing about one million
entries). There are indexes on the foreign keys.
Now I wanted to delete about 10
On Mon, Dec 19, 2011 at 18:14, Pavel Stehule pavel.steh...@gmail.com wrote:
you can disable check per session if you need
ALTER TABLE ... DISABLE TRIGGER ALL;
This is NOT a per-session command, this applies to all connections and
queries, and may allow incorrect data into the table. Don't do
2011/12/19 Marti Raudsepp ma...@juffo.org:
On Mon, Dec 19, 2011 at 18:14, Pavel Stehule pavel.steh...@gmail.com wrote:
you can disable check per session if you need
ALTER TABLE ... DISABLE TRIGGER ALL;
This is NOT a per-session command, this applies to all connections and
queries, and may
Hi Daniel,
Now I wanted to delete about 10 million addresses (that are not
referenced anymore from anywhere), and have a statement like:
What about:
DELETE FROM address
WHERE id IN (
SELECT id FROM address
EXCEPT
(
SELECT address_id FROM tab1
UNION ALL