Sub-selects taking way too long.. - Mailing list pgsql-general

From Alexis Maldonado
Subject Sub-selects taking way too long..
Date
Msg-id 003e01c1e003$2f52be00$14818b0a@ctcd.cc.tx.us
Whole thread Raw
In response to Hash Join vs Nested Loops in 7.2.1 ...  (Ed Loehr <pggeneral@bluepolka.net>)
Responses Re: Sub-selects taking way too long..  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Ok.. I know its provably something im doing dumb..
but here it goes..

I have 2 tables that are the same:

"temp_table" and "table"

"temp _table" has 7,761 rows and "table" is empty

the columns for both tables are: ID (primary key sequence), index, column1,
column2

when i run:

Insert Into table
select index, column1, column2
from temp_table
where index NOT IN (select index from table)

it takes 40 MINUTES to execute..
i dont know what im doing wrong here both tables have "index" indexed ..
help...


pgsql-general by date:

Previous
From: Jean-Luc Lachance
Date:
Subject: table alias nor valid for delete
Next
From: "David Esposito"
Date:
Subject: Re: vacuuming not working?