Re: forced sequential scan when condition has current_user - Mailing list pgsql-performance

From Tom Lane
Subject Re: forced sequential scan when condition has current_user
Date
Msg-id 28309.1262668555@sss.pgh.pa.us
Whole thread Raw
In response to Re: forced sequential scan when condition has current_user  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-performance
Craig Ringer <craig@postnewspapers.com.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
indexscan: 

> 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

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_connect takes 3.0 seconds
Next
From: Brad Nicholson
Date:
Subject: Re: DB is slow until DB is reloaded