explain.depesz.com

PostgreSQL's explain analyze made readable

Result: K1fL

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 274.834 ↓ 50.0 100 1

Limit (cost=69,451.06..69,451.07 rows=2 width=33) (actual time=274.819..274.834 rows=100 loops=1)

2. 0.862 274.822 ↓ 50.0 100 1

Sort (cost=69,451.06..69,451.07 rows=2 width=33) (actual time=274.818..274.822 rows=100 loops=1)

  • Sort Key: (max(test.subscore_value)) DESC
  • Sort Method: top-N heapsort Memory: 36kB
3. 2.163 273.960 ↓ 3,021.5 6,043 1

GroupAggregate (cost=69,451.02..69,451.05 rows=2 width=33) (actual time=271.298..273.960 rows=6,043 loops=1)

  • Group Key: test.id
4. 22.099 271.797 ↓ 5,000.0 10,000 1

Sort (cost=69,451.02..69,451.02 rows=2 width=33) (actual time=271.290..271.797 rows=10,000 loops=1)

  • Sort Key: test.id
  • Sort Method: quicksort Memory: 1166kB
5. 1.067 249.698 ↓ 5,000.0 10,000 1

Subquery Scan on test (cost=69,450.98..69,451.01 rows=2 width=33) (actual time=237.409..249.698 rows=10,000 loops=1)

6. 10.495 248.631 ↓ 5,000.0 10,000 1

Limit (cost=69,450.98..69,450.99 rows=2 width=115) (actual time=237.406..248.631 rows=10,000 loops=1)

7. 1.372 238.136 ↓ 5,000.0 10,000 1

Sort (cost=69,450.98..69,450.99 rows=2 width=115) (actual time=237.406..238.136 rows=10,000 loops=1)

  • Sort Key: factual_report_subscore.subscore_value DESC
  • Sort Method: top-N heapsort Memory: 2035kB
8. 11.356 236.764 ↓ 18,224.0 36,448 1

Gather (cost=1,004.89..69,450.97 rows=2 width=115) (actual time=186.791..236.764 rows=36,448 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
9. 35.716 225.408 ↓ 7,290.0 7,290 5

Nested Loop (cost=4.89..68,450.77 rows=1 width=115) (actual time=182.740..225.408 rows=7,290 loops=5)

10. 81.574 189.688 ↓ 7,397.0 7,397 5

Hash Join (cost=4.46..68,450.25 rows=1 width=58) (actual time=182.686..189.688 rows=7,397 loops=5)

  • Hash Cond: ((factual_report_subscore.factual_report_id)::text = (factual_report_permission.factual_report_id)::text)
11. 101.023 101.023 ↑ 1.3 813,229 5

Parallel Seq Scan on factual_report_subscore (cost=0.00..65,758.46 rows=1,023,746 width=33) (actual time=0.012..101.023 rows=813,229 loops=5)

12. 2.609 7.091 ↓ 10,445.0 10,445 5

Hash (cost=4.45..4.45 rows=1 width=25) (actual time=7.090..7.091 rows=10,445 loops=5)

  • Buckets: 16384 (originally 1024) Batches: 1 (originally 1) Memory Usage: 710kB
13. 4.482 4.482 ↓ 10,445.0 10,445 5

Index Scan using idx_fr_perm_org_id on factual_report_permission (cost=0.43..4.45 rows=1 width=25) (actual time=0.050..4.482 rows=10,445 loops=5)

  • Index Cond: ((organization_id)::text = '5af58c0bb2823c23576937e2'::text)
14. 0.004 0.004 ↑ 1.0 1 36,985

Index Scan using factual_report_pkey on factual_report fr (cost=0.43..0.52 rows=1 width=25) (actual time=0.004..0.004 rows=1 loops=36,985)

  • Index Cond: ((id)::text = (factual_report_subscore.factual_report_id)::text)
  • Filter: ((valid_to >= '2003-01-01 08:57:01'::timestamp without time zone) AND (valid_from <= '2019-11-01 09:27:01'::timestamp without time zone) AND (epicenter_lat >= '-56.2999999999999972'::double precision) AND (epicenter_lat <= '72.0999999999999943'::double precision) AND (epicenter_long >= '-179'::double precision) AND (epicenter_long <= '179'::double precision))
  • Rows Removed by Filter: 0
Planning time : 2.361 ms
Execution time : 274.893 ms