ctid matching behavior changed?

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: ctid matching behavior changed?
Date: 2003-09-25 23:31:43
Message-ID: 904ee125f0bea4b3d18477cb25060062@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message

Why is the subselect never executed for the inner select?

pgrocks=> SELECT VERSION() UNION ALL SELECT oid::text FROM pg_class WHERE ctid = (SELECT ctid FROM pg_class LIMIT 1);
version
--------------------------------------------------------------
PostgreSQL 7.3.4 on i686-pc-linux-gnu, compiled by GCC 3.0.1
16416
(2 rows)

pgrocks=> SELECT VERSION() UNION ALL SELECT oid::text FROM pg_class WHERE ctid = (SELECT ctid FROM pg_class LIMIT 1);
version
-----------------------------------------------------------------
PostgreSQL 7.4beta3 on i686-pc-linux-gnu, compiled by GCC 3.0.1
(1 row)

7.3.4:
pgrocks=> EXPLAIN ANALYZE SELECT oid FROM pg_class WHERR ctid = (SELECT ctid FROM pg_class LIMIT 1);
QUERY PLAN
------------------------------------------------------------------------------------------------------
Tid Scan on pg_class (cost=0.00..4.01 rows=1 width=4) (actual time=0.01..0.01 rows=1 loops=1)
Filter: (ctid = $0)
InitPlan
-> Limit (cost=0.00..0.03 rows=1 width=6) (actual time=0.02..0.03 rows=1 loops=1)
-> Seq Scan on pg_class (cost=0.00..21.82 rows=682 width=6) (actual time=0.02..0.02 rows=2 loops=1)

7.4beta3:
pgrocks=> EXPLAIN ANALYZE SELECT oid FROM pg_class WHERR ctid = (SELECT ctid FROM pg_class LIMIT 1);
QUERY PLAN
------------------------------------------------------------------------------------------------
Tid Scan on pg_class (cost=0.04..4.05 rows=2 width=4) (actual time=0.00..0.00 rows=0 loops=1)
Filter: (ctid = $0)
InitPlan
-> Limit (cost=0.00..0.04 rows=1 width=6) (never executed)
-> Seq Scan on pg_class (cost=0.00..9.30 rows=230 width=6) (never executed)

--
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200309251929
-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE/c3r2vJuQZxSWSsgRAjorAJ9SyKGsLWk0zQkn1a6f63itq/p1xACg06IF
J28TltScrDcHvUec97RsTTM=
=3W1F
-----END PGP SIGNATURE-----

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-26 00:04:08 Re: pgsql-server/src/backend catalog/index.c comma ...
Previous Message Myron Scott 2003-09-25 23:19:21 Re: Threads vs Processes