Re: BUG #13824: EXISTS sometimes uses seq scan instead of index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: grzegorz(at)thulium(dot)pl
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13824: EXISTS sometimes uses seq scan instead of index
Date: 2015-12-18 01:17:41
Message-ID: 13864.1450401461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

grzegorz(at)thulium(dot)pl writes:
> Whenever I perform select like below, planner thinks it's going to look up
> many rows and falls back to seq scan. If I disable seq scan, it correctly
> uses the index.

You might need to reduce random_page_cost to reflect your environment
better ... especially if you're most concerned about performance with
all data already cached in memory, which is what these examples are
probably showing.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message jamcar.guedes 2015-12-18 02:08:50 BUG #13826: Error 10061
Previous Message Tom Lane 2015-12-18 00:53:05 Re: Known issues on PostgreSQL server 8.1.19