Re: key = currval('tab_key_seq') choses SEQSCAN?! - Mailing list pgsql-general

From Martin Marques
Subject Re: key = currval('tab_key_seq') choses SEQSCAN?!
Date
Msg-id 200402251908.24347.martin@bugs.unl.edu.ar
Whole thread Raw
In response to key = currval('tab_key_seq') choses SEQSCAN?!  (Brandon Craig Rhodes <brandon@oit.gatech.edu>)
List pgsql-general
El Mié 25 Feb 2004 18:52, Brandon Craig Rhodes escribió:
>
> But this same table suddenly becomes unwilling to use an index scan if
> the target value is the result of the currval() function:
>
> # explain select * from changes where change =
> currval('changes_change_seq'); QUERY PLAN

Try with this:

explain select * from changes where change = (SELECT
currval('changes_change_seq'))::INT;

--
 19:06:01 up 92 days,  1:15,  3 users,  load average: 0.72, 0.37, 0.24
-----------------------------------------------------------------
Martín Marqués        | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
             Universidad Nacional
                  del Litoral
-----------------------------------------------------------------


pgsql-general by date:

Previous
From: Brandon Craig Rhodes
Date:
Subject: key = currval('tab_key_seq') choses SEQSCAN?!
Next
From: "Sally Sally"
Date:
Subject: reindexing, pg_class (and other system tables)