Understanding EXPLAIN ANALYZE estimates when loops != 1

From: Philip Semanchuk <philip(at)americanefficient(dot)com>
To: PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Understanding EXPLAIN ANALYZE estimates when loops != 1
Date: 2020-08-19 21:55:49
Message-ID: 5A55FB13-6DE3-4F5E-A951-65EF83EF0161@americanefficient.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
I could use some help interpreting EXPLAIN ANALYZE output.

-> Index Scan using ix_foo on t1 (cost=0.69..68.57 rows=3283 width=105) (actual time=0.006..0.918 rows=3760 loops=94)

The actual rows returned by this plan node ~= 3760 * 94 = 353,440. Did postgres expect (estimate) 3283 rows from this join, or 3283 * 94 = 308,602?

Same question for this node.

-> Parallel Index Scan using pk_xyz on xyz (cost=0.29..2354.67 rows=54285 width=25) (actual time=0.049..6.326 rows=14864 loops=5)

Actual rows ~= 14864 * 5 = 74,320, estimate = 54285 or 54285 * 5?

THanks
Philip

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shantanu Shekhar 2020-08-19 22:15:30 Sequence generating negative numbers
Previous Message Pól Ua Laoínecháin 2020-08-19 21:32:55 Re: Interpolation problem - pg 12.4 - full correct version!