X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 39B9956A30 for ; Thu, 17 Mar 2005 12:03:21 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04269-07 for ; Thu, 17 Mar 2005 12:03:15 +0000 (GMT) Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by svr1.postgresql.org (Postfix) with ESMTP id B5A7356A1F for ; Thu, 17 Mar 2005 12:03:13 +0000 (GMT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id j2HD65825795 for ; Thu, 17 Mar 2005 14:06:06 +0100 Received: from [127.0.0.1] (accesspoint.mm.eutelsat.org [194.214.173.4]) by nts-03.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id j2HC3ER32535 for ; Thu, 17 Mar 2005 13:03:14 +0100 Message-ID: <423971F2.3050701@bigfoot.com> Date: Thu, 17 Mar 2005 13:02:58 +0100 From: Gaetano Mendola User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "pgsql-performance@postgresql.org" Subject: 2 rows expected on a primary key X-Enigmail-Version: 0.90.1.1 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.372 tagged_above=0 required=5 tests=AWL, TO_ADDRESS_EQ_REAL X-Spam-Level: X-Archive-Number: 200503/355 X-Sequence-Number: 11060 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I'm running a 7.4.x engine and I'm seeing in a explain analyze: - -> Hash (cost=4.00..4.00 rows=2 width=16) (actual time=30.542..30.542 rows=0 loops=1) -> Index Scan using user_login_login_key on user_login ul (cost=0.00..4.00 rows=2 width=16) (actual time=30.482..30.490 rows=1 loops=1) Index Cond: ((login)::text = 'Zoneon'::text) why postgres perform an extimation of 2 rows knowing that column it's a primary key ? If I do an explain analyze directly on the table I get: # explain analyze select * from user_login where login = 'Zoneon'; QUERY PLAN - ---------------------------------------------------------------------------------------------------------------------------------- Index Scan using user_login_login_key on user_login (cost=0.00..4.00 rows=1 width=16) (actual time=0.050..0.052 rows=1 loops=1) Index Cond: ((login)::text = 'Zoneon'::text) Total runtime: 4.627 ms (3 rows) btw, is it normal that cast ? Regards Gaetano Mendola -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCOXHy7UpzwH2SGd4RAgwAAJ9SMJ3OfYjv03IhhTbJ9GSLby4nfwCg5ezu UOH8wXRsNAvWRni7GSKlMps= =6yFm -----END PGP SIGNATURE-----