explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DNkW

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 4,558.102 ↑ 1.0 5 1

Limit (cost=82,224.46..82,224.47 rows=5 width=4) (actual time=4,558.101..4,558.102 rows=5 loops=1)

2.          

CTE paths

3. 6.897 6.897 ↑ 1,000.0 1 1

Function Scan on get_custom_values_path paths_1 (cost=0.25..32.75 rows=1,000 width=216) (actual time=6.896..6.897 rows=1 loops=1)

4. 0.014 4,558.100 ↑ 5.4 5 1

Sort (cost=82,191.71..82,191.78 rows=27 width=4) (actual time=4,558.100..4,558.100 rows=5 loops=1)

  • Sort Key: z.auction_date
  • Sort Method: top-N heapsort Memory: 25kB
5. 0.704 4,558.086 ↑ 2.1 13 1

HashAggregate (cost=82,190.99..82,191.26 rows=27 width=4) (actual time=4,558.083..4,558.086 rows=13 loops=1)

  • Group Key: z.auction_date
6. 1,241.911 4,557.382 ↑ 4.0 3,132 1

Hash Join (cost=81,891.30..82,159.30 rows=12,675 width=4) (actual time=3,628.111..4,557.382 rows=3,132 loops=1)

  • Hash Cond: (paths.id_child_of_market = zp.customer_id)
7. 6.927 6.927 ↑ 1,000.0 1 1

CTE Scan on paths (cost=0.00..20.00 rows=1,000 width=4) (actual time=6.925..6.927 rows=1 loops=1)

8. 969.279 3,308.544 ↓ 225.9 4,543,233 1

Hash (cost=81,639.85..81,639.85 rows=20,116 width=8) (actual time=3,308.544..3,308.544 rows=4,543,233 loops=1)

  • Buckets: 131072 (originally 32768) Batches: 256 (originally 1) Memory Usage: 3488kB
9. 1,313.534 2,339.265 ↓ 225.9 4,543,233 1

Hash Join (cost=11,070.31..81,639.85 rows=20,116 width=8) (actual time=102.859..2,339.265 rows=4,543,233 loops=1)

  • Hash Cond: (zp.zaiko_group_id = z.group_id)
10. 357.358 1,011.051 ↑ 1.0 3,334,500 1

Append (cost=0.00..57,864.00 rows=3,334,501 width=8) (actual time=0.219..1,011.051 rows=3,334,500 loops=1)

11. 0.034 0.034 ↓ 0.0 0 1

Seq Scan on zaiko_publish zp (cost=0.00..0.00 rows=1 width=8) (actual time=0.034..0.034 rows=0 loops=1)

12. 653.659 653.659 ↑ 1.0 3,334,500 1

Seq Scan on zaiko_publish zp_1 (cost=0.00..57,864.00 rows=3,334,500 width=8) (actual time=0.182..653.659 rows=3,334,500 loops=1)

13. 4.176 14.680 ↓ 162.4 4,386 1

Hash (cost=11,069.98..11,069.98 rows=27 width=8) (actual time=14.680..14.680 rows=4,386 loops=1)

  • Buckets: 8192 (originally 1024) Batches: 1 (originally 1) Memory Usage: 236kB
14. 0.700 10.504 ↓ 162.5 4,387 1

Append (cost=0.00..11,069.98 rows=27 width=8) (actual time=0.140..10.504 rows=4,387 loops=1)

15. 0.013 0.013 ↓ 0.0 0 1

Seq Scan on zaiko z (cost=0.00..0.00 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=1)

  • Filter: ((id = orgid) AND (auction_date > date_trunc('day'::text, now())))
16. 9.791 9.791 ↓ 168.7 4,387 1

Index Scan using zaiko_auction_date_idx on zaiko z_1 (cost=0.43..11,069.98 rows=26 width=8) (actual time=0.122..9.791 rows=4,387 loops=1)

  • Index Cond: (auction_date > date_trunc('day'::text, now()))
  • Filter: (id = orgid)
  • Rows Removed by Filter: 1603
Planning time : 0.819 ms
Execution time : 4,558.230 ms