Sorry. Maybe I should refrase my question.
I have two tables A and B.
Each table contains a non-unique indexed varchar column.
Table A contains around 500000 rows
table B contains around 4 million rows
for a given value of col there are typically 3 records in A and
20 records in B (give or take)
I want to do something like this:
select a.somecol from A left join B on B.col = A.col where A.date > '2001-01-01';
But this query runs for hours on an eight core server with 4G etc etc.
I configured PG to use 128Mb shared memory, but fiddling with that value
doesn't change much..
And I continuously see the planner choosing for seq scans.
I don't get it.
http://www.neonova.nl Science Park 140 1098 XG Amsterdam
info: 020-5611300 servicedesk: 020-5611302 fax: 020-5611301
KvK Amsterdam 34151241
Op dit bericht is de volgende disclaimer van toepassing:
In response to
pgsql-novice by date
|Next:||From: Tom Lane||Date: 2009-09-18 15:11:48|
|Subject: Re: Index not used in join.. (example included). |
|Previous:||From: Tom Lane||Date: 2009-09-18 14:10:50|
|Subject: Re: Index not used in join.. (example included) |