explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gNOm : Optimization for: Without index; plan #IMtM

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 2,086.099 ↑ 1.0 200 1

Limit (cost=118,606.33..122,042.13 rows=200 width=61) (actual time=2,075.443..2,086.099 rows=200 loops=1)

2.          

Initplan (for Limit)

3. 0.000 2,075.386 ↑ 1.0 1 1

Limit (cost=118,605.49..118,605.60 rows=1 width=4) (actual time=2,075.384..2,075.386 rows=1 loops=1)

4. 11.009 2,075.451 ↑ 3,388,196.0 1 1

Gather Merge (cost=118,605.49..513,922.62 rows=3,388,196 width=4) (actual time=2,075.382..2,075.451 rows=1 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 928.889 2,064.442 ↑ 1,694,098.0 1 3 / 3

Sort (cost=117,605.46..121,840.71 rows=1,694,098 width=4) (actual time=2,064.441..2,064.442 rows=1 loops=3)

  • Sort Key: fact_monthly.report_date DESC
  • Sort Method: top-N heapsort Memory: 25kB
  • Worker 0: Sort Method: top-N heapsort Memory: 25kB
  • Worker 1: Sort Method: top-N heapsort Memory: 25kB
6. 1,135.553 1,135.553 ↑ 1.2 1,355,437 3 / 3

Parallel Seq Scan on fact_monthly (cost=0.00..109,134.97 rows=1,694,098 width=4) (actual time=0.024..1,135.553 rows=1,355,437 loops=3)

  • Filter: (model_id = ANY ('{2,3}'::integer[]))
  • Rows Removed by Filter: 5330
7. 2,075.893 2,085.846 ↑ 101.6 200 1

Nested Loop (cost=0.72..349,233.01 rows=20,329 width=61) (actual time=2,075.441..2,085.846 rows=200 loops=1)

8. 1.064 9.753 ↑ 101.6 200 1

Nested Loop (cost=0.57..345,815.17 rows=20,329 width=29) (actual time=0.045..9.753 rows=200 loops=1)

9. 0.951 8.489 ↑ 101.6 200 1

Subquery Scan on cte (cost=0.43..342,561.23 rows=20,329 width=18) (actual time=0.034..8.489 rows=200 loops=1)

  • Filter: (cte.rank = 1)
  • Rows Removed by Filter: 1022
10. 3.975 7.538 ↑ 3,327.2 1,222 1

WindowAgg (cost=0.43..291,738.30 rows=4,065,834 width=34) (actual time=0.032..7.538 rows=1,222 loops=1)

11. 3.563 3.563 ↑ 3,324.5 1,223 1

Index Scan using idx_mdl_fact_monthly_sort on fact_monthly fm (cost=0.43..190,092.45 rows=4,065,834 width=26) (actual time=0.018..3.563 rows=1,223 loops=1)

  • Filter: (model_id = ANY ('{2,3}'::integer[]))
12. 0.200 0.200 ↑ 1.0 1 200

Index Scan using thing_pkey on thing t (cost=0.14..0.16 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=200)

  • Index Cond: (thing_id = cte.thing_id)
13. 0.200 0.200 ↑ 1.0 1 200

Index Scan using item_pkey on item i (cost=0.15..0.17 rows=1 width=36) (actual time=0.001..0.001 rows=1 loops=200)

  • Index Cond: (item_id = cte.item_id)
Planning time : 0.359 ms
Execution time : 2,086.384 ms