Skip site navigation (1) Skip section navigation (2)

seq scan only when function not in subquery (bug?)

From: Brett McCormick <brett(at)web0(dot)speakeasy(dot)org>
To: pgsql-hackers(at)hub(dot)org
Subject: seq scan only when function not in subquery (bug?)
Date: 1998-06-15 23:44:31
Message-ID: 199806152344.QAA17839@web0.speakeasy.org (view raw or flat)
Thread:
Lists: pgsql-hackers
sas=> explain update user set usrid = 'aaaaaaaa' where usrseqid=usrseqid('zlb');

NOTICE:  QUERY PLAN:

Seq Scan on user  (cost=344.07 size=658 width=154)

EXPLAIN
sas=> explain update user set usrid = 'aaaaaaaa' where usrseqid=(select usrseqid('zlb'));
NOTICE:  QUERY PLAN:

Index Scan on user  (cost=1.05 size=1 width=154)
  InitPlan
    ->  Result  (cost=0.00 size=0 width=0)

EXPLAIN
sas=> 


as you can see, it uses the index when the RHS of the comparison in the where
clause is a subquery, but a sequential scan when it isn't.  is this a bug?

Responses

pgsql-hackers by date

Next:From: Vadim MikheevDate: 1998-06-16 02:32:39
Subject: Re: [HACKERS] seq scan only when function not in subquery (bug?)
Previous:From: David HartwigDate: 1998-06-15 23:15:37
Subject: Re: [HACKERS] User authentification failed

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group