explain.depesz.com

PostgreSQL's explain analyze made readable

Result: oT4c

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

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

2.          

CTE paths

3. 7.342 7.342 ↑ 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=7.340..7.342 rows=1 loops=1)

4. 0.012 4,961.049 ↑ 5.4 5 1

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

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

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

  • Group Key: z.auction_date
6. 1,206.636 4,960.446 ↑ 4.0 3,132 1

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

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

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

8. 1,216.909 3,746.460 ↓ 225.9 4,543,233 1

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

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

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

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

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

11. 0.011 0.011 ↓ 0.0 0 1

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

12. 665.370 665.370 ↑ 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.115..665.370 rows=3,334,500 loops=1)

13. 1.398 11.754 ↓ 162.4 4,386 1

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

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

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

15. 0.003 0.003 ↓ 0.0 0 1

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

  • Filter: ((id = orgid) AND (auction_date > date_trunc('day'::text, now())))
16. 9.690 9.690 ↓ 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.036..9.690 rows=4,387 loops=1)

  • Index Cond: (auction_date > date_trunc('day'::text, now()))
  • Filter: (id = orgid)
  • Rows Removed by Filter: 1603