Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-05 Thread Keresztury Balázs
3:16 PM To: 'Keresztury Balázs'; pgsql-performance@postgresql.org Subject: RE: [PERFORM] forced sequential scan when condition has current_user > -Mensaje original- > De: Keresztury Balázs > > hi, > > just a small question: is it normal that PostgreSQL 8.4

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-05 Thread Fernando Hevia
> -Mensaje original- > De: Keresztury Balázs > > hi, > > just a small question: is it normal that PostgreSQL 8.4.1 > always uses sequential scanning on any table when there is a > condition having the constant "current_user"? Of course there > is a btree index set on that table, but

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Tom Lane
Craig Ringer 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

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Craig Ringer
Erik Jones wrote: > On Jan 4, 2010, at 1:59 PM, Robert Haas wrote: > >> The thing is, PostgreSQL doesn't know at planning time what the value of >> current_user() will be, so the plan can't depend on that; the planner >> just takes its best shot. > > current_user() is a stable function and the m

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Robert Haas
2010/1/4 Erik Jones : > On Jan 4, 2010, at 1:59 PM, Robert Haas wrote: >> The thing is, PostgreSQL doesn't know at planning time what the value of >> current_user() will be, so the plan can't depend on that; the planner >> just takes its best shot. > > current_user() is a stable function and the ma

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Erik Jones
On Jan 4, 2010, at 1:59 PM, Robert Haas wrote: > The thing is, PostgreSQL doesn't know at planning time what the value of > current_user() will be, so the plan can't depend on that; the planner > just takes its best shot. current_user() is a stable function and the manual is explicit that the r

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Keresztury Balázs
you think this is actually a bug, not a feature? balazs -Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Monday, January 04, 2010 10:59 PM To: Keresztury Balázs Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] forced sequential scan when condition has curr

Re: [PERFORM] forced sequential scan when condition has current_user

2010-01-04 Thread Robert Haas
2010/1/4 Keresztury Balázs : > just a small question: is it normal that PostgreSQL 8.4.1 always uses > sequential scanning on any table when there is a condition having the > constant "current_user"? Of course there is a btree index set on that table, > but the DBMS just doesn't want to utilize it.