Thread: strange query plans, won't use index

strange query plans, won't use index

From
Dustin Sallings
Date:
        Does anybody know where there is a difference here:

photo=> explain select cat from wwwacl where userid=getwwwuser('dustin');
NOTICE:  QUERY PLAN:

Seq Scan on wwwacl  (cost=2.65 size=5 width=4)

EXPLAIN
photo=> explain select cat from wwwacl where userid=6;
NOTICE:  QUERY PLAN:

Index Scan using acl_byid on wwwacl  (cost=2.24 size=5 width=4)

EXPLAIN

        getwwwuser('dustin') returns 6 here.


--
SA, beyond.com           My girlfriend asked me which one I like better.
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin@spy.net>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________