SELECT ... EXCEPT SELECT ... takes too long! Why? - Mailing list pgsql-general

From Michael Andreasen
Subject SELECT ... EXCEPT SELECT ... takes too long! Why?
Date
Msg-id 3779E8D1.9DC1315E@systems.to
Whole thread Raw
List pgsql-general
I have a table;

create table product ( prod varchar(10) description varchar(40));

This is the master table. I also have serval other tables the same
(varchar(10), varchar(40)) and want to merge the rows from these tables
into the master one, only where rows don't already exist in the master
table.

I am doing this as follows;

insert into product
select prod, description from product_copy1 except
select prod, description from product;

This does work, but it takes FOREVER to perform. I have about 10,000
rows in each table and it is taking 20 mins. On the same System I can do
4,000,000 row inserts in 6 minutes, so this to slow.

Any help?



pgsql-general by date:

Previous
From: inlin
Date:
Subject: About the restore from V1.09 to V6.3.2
Next
From: "Stephen Boyle"
Date:
Subject: Postgres Upsizing Tool for MSAccess 97