explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YtNa

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 265,152.171 ↑ 1.0 5 1

Limit (cost=33.20..37,964.25 rows=5 width=4) (actual time=365.727..265,152.171 rows=5 loops=1)

2.          

CTE paths

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

4. 3.945 265,152.165 ↑ 5.4 5 1

Unique (cost=0.45..204,828.10 rows=27 width=4) (actual time=365.725..265,152.165 rows=5 loops=1)

5. 149.525 265,148.220 ↓ 3.1 2,895 1

Nested Loop (cost=0.45..204,825.73 rows=949 width=4) (actual time=365.720..265,148.220 rows=2,895 loops=1)

  • Join Filter: (zp.customer_id = paths.id_child_of_market)
  • Rows Removed by Join Filter: 263219
6. 116,941.228 264,732.581 ↓ 176.7 266,114 1

Nested Loop (cost=0.45..170,930.73 rows=1,506 width=8) (actual time=359.166..264,732.581 rows=266,114 loops=1)

  • Join Filter: (z.group_id = zp.zaiko_group_id)
  • Rows Removed by Join Filter: 1016608275
7. 3.846 37.309 ↓ 146.0 3,942 1

Merge Append (cost=0.45..11,070.20 rows=27 width=8) (actual time=0.042..37.309 rows=3,942 loops=1)

  • Sort Key: z.auction_date
8. 0.005 0.008 ↓ 0.0 0 1

Sort (cost=0.01..0.02 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1)

  • Sort Key: z.auction_date
  • Sort Method: quicksort Memory: 25kB
9. 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())))
10. 33.455 33.455 ↓ 151.6 3,942 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.033..33.455 rows=3,942 loops=1)

  • Index Cond: (auction_date > date_trunc('day'::text, now()))
  • Filter: (id = orgid)
  • Rows Removed by Filter: 1493
11. 147,597.239 147,754.044 ↓ 1.0 257,959 3,942

Materialize (cost=0.00..34,002.81 rows=249,644 width=8) (actual time=0.012..37.482 rows=257,959 loops=3,942)

12. 34.752 156.805 ↓ 1.0 257,961 1

Append (cost=0.00..31,778.59 rows=249,644 width=8) (actual time=26.219..156.805 rows=257,961 loops=1)

13. 0.003 0.003 ↓ 0.0 0 1

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

  • Filter: (market_id IS NULL)
14. 97.481 122.050 ↓ 1.0 257,961 1

Bitmap Heap Scan on zaiko_publish zp_1 (cost=4,763.16..31,778.59 rows=249,643 width=8) (actual time=26.215..122.050 rows=257,961 loops=1)

  • Recheck Cond: (market_id IS NULL)
  • Heap Blocks: exact=7331
15. 24.569 24.569 ↓ 1.0 257,961 1

Bitmap Index Scan on zaiko_publish_market_id_customer_id_idx (cost=0.00..4,700.75 rows=249,643 width=0) (actual time=24.569..24.569 rows=257,961 loops=1)

  • Index Cond: (market_id IS NULL)
16. 266.114 266.114 ↑ 1,000.0 1 266,114

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