Re: forced sequential scan when condition has current_user

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Erik Jones <ejones(at)engineyard(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Keresztury Balázs <balazs(at)gaslightmusic(dot)hu>, pgsql-performance(at)postgresql(dot)org
Subject: Re: forced sequential scan when condition has current_user
Date: 2010-01-05 05:15:55
Message-ID: 28309.1262668555@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> Erik Jones wrote:
>> current_user() is a stable function and the manual is explicit that the result of stable function can be used in an index scan:

> Yes ... but the planner doesn't know the value current_user will return,

I think it's got nothing to do with that and everything to do with the
fact that he's comparing to a varchar rather than text column ...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Brad Nicholson 2010-01-05 13:17:38 Re: DB is slow until DB is reloaded
Previous Message Tom Lane 2010-01-05 05:14:09 Re: pg_connect takes 3.0 seconds