2 rows expected on a primary key - Mailing list pgsql-performance

From Gaetano Mendola
Subject 2 rows expected on a primary key
Date
Msg-id 423971F2.3050701@bigfoot.com
Whole thread Raw
List pgsql-performance
-----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.490rows=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=1loops=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-----


pgsql-performance by date:

Previous
From: Manfred Koizar
Date:
Subject: Re: multi-column index
Next
From: Ales Vojacek
Date:
Subject: TOP 10 SQL commands and more