Re: Index not used in join.. (example included). - Mailing list pgsql-novice

From Ron Arts
Subject Re: Index not used in join.. (example included).
Date
Msg-id 4AB398D4.4080308@neonova.nl
Whole thread Raw
In response to Re: Index not used in join.. (example included)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Index not used in join.. (example included).  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
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.

Ron

--
NeoNova BV
innovatieve internetoplossingen

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:
http://www.neonova.nl/maildisclaimer

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index not used in join.. (example included)
Next
From: Tom Lane
Date:
Subject: Re: Index not used in join.. (example included).