explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6kTj : Optimization for: plan #YQoy

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 1.511 258.679 ↓ 1.4 9,490 1

Subquery Scan on unused (cost=0.43..60,040.65 rows=6,667 width=540) (actual time=0.133..258.679 rows=9,490 loops=1)

  • Filter: (unused.running_size <= 3,780,000)
  • Rows Removed by Filter: 10,510
  • loops=1)
2. 0.945 257.168 ↑ 1.0 20,000 1

Limit (cost=0.43..59,790.65 rows=20,000 width=548) (actual time=0.131..257.168 rows=20,000 loops=1)

3. 16.230 256.223 ↑ 25.7 20,000 1

WindowAgg (cost=0.43..1,533,873.54 rows=513,085 width=548) (actual time=0.131..256.223 rows=20,000 loops=1)

4. 149.837 239.993 ↑ 25.7 20,001 1

Nested Loop (cost=0.43..1,526,177.26 rows=513,085 width=544) (actual time=0.068..239.993 rows=20,001 loops=1)

  • Join Filter: (events.cluster_id = clusters.cluster_id)
  • Rows Removed by Join Filter: 1,098,906
5. 90.156 90.156 ↑ 14.1 159,844 1

Index Scan using events_pkey on events (cost=0.43..1,356,857.99 rows=2,257,575 width=552) (actual time=0.017..90.156 rows=159,844 loops=1)

  • Index Cond: ((msg_offset >= 61,000,326) AND (msg_offset <= 64,182,340))
  • Filter: ((type)::text = ANY ('{prices-v1,reference-data-v5,product-base-document,search-product,location,selling-restrictions,colleague-facts-jobs}'::text[]))
6. 0.000 0.000 ↓ 1.4 7 159,844

Materialize (cost=0.00..1.16 rows=5 width=8) (actual time=0.000..0.000 rows=7 loops=159,844)

  • -> Seq Scan on clusters (cost=0.00..1.14 rows=5 width=8) (actual time=0.007..0.018 rows=7
  • Filter: ((cluster_uuid)::text = ANY ('{NONE,417bda80-bfba-412c-9b52-c35d68530342,0ebc3b5d-81be-4f20-9c7d-022afe913356,05e7673f-b28d-491a-82b4-08a836112e2a,9938734d-6991-4497-aea4-68a8b1c40ffc,6c1b27c2-911d-4abf-be6b-6e043713f490,bfc03ffe-e78f-4aee-a2ec-b7b2c616dfa6,7293a0f2-bd28-4b73-b81c-5165d3ddded0,97b05cbb-897d-49ca-b338-330a38d3bd82,769d8c7f-8d92-4423-8f92-ab2331206ed6}'::text[]))
  • Rows Removed by Filter: 16
Planning time : 0.341 ms
Execution time : 259.053 ms