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

7.3.2 indexes in PL/PgSQL

From: Evgeny Duzhakow <diabolo(at)philol(dot)msu(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: 7.3.2 indexes in PL/PgSQL
Date: 2003-04-21 09:49:06
Message-ID: Pine.LNX.4.20.0304211343380.25047-100000@zeus.philol.msu.ru (view raw or flat)
Thread:
Lists: pgsql-bugs
I have select like that:

SELECT playerid FROM players WHERE nickname = 'qq' AND password = 'qqq';

query plan:

auction=# explain SELECT playerid FROM players WHERE nickname = 'qq' AND
password = 'qqq';
                                            QUERY PLAN                   

--------------------------------------------------------------------------------------------------
 Index Scan using nick_pass on players  (cost=0.00..6.01 rows=1 width=4)
    Index Cond: ((nickname = 'qq'::character varying) AND ("password" = 'qqq'::character varying))
(2 rows)

but in procedure on PL/PgSQL this select realy do sequense scan:

--- cut from create_session procedure ---
SELECT playerid INTO _playerid FROM players WHERE nickname = _nickname AND password = _passwd;
--- cut ---

Where i'm wrong? or that realy bug?

always thanks.

                Diabolo.

---                                                                       ---
   System Administrator of                          Phone: +7-095-939-1478
      the Philological Faculty of         E-Mail: diabolo(at)philol(dot)msu(dot)ru
         Moscow State University.      Web: http://www.philol.msu.ru


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2003-04-21 14:18:31
Subject: Bug #951: Creating table fails if inherited table has no columns.
Previous:From: bmpDate: 2003-04-21 08:06:58
Subject: Primary key violation

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