explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hNs1

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 6,554.329 ↑ 1.0 100 1

Limit (cost=471,979.90..471,980.15 rows=100 width=74) (actual time=6,554.315..6,554.329 rows=100 loops=1)

2. 330.926 6,554.318 ↑ 23,902.2 100 1

Sort (cost=471,979.90..477,955.46 rows=2,390,223 width=74) (actual time=6,554.313..6,554.318 rows=100 loops=1)

  • Sort Key: (max(factual_report_subscore.subscore_value)) DESC
  • Sort Method: top-N heapsort Memory: 48kB
3. 1,565.441 6,223.392 ↑ 1.1 2,108,130 1

HashAggregate (cost=356,725.07..380,627.30 rows=2,390,223 width=74) (actual time=5,735.466..6,223.392 rows=2,108,130 loops=1)

  • Group Key: fr.id
4. 1,053.717 4,657.951 ↑ 1.0 4,059,951 1

Hash Join (cost=218,282.01..336,251.07 rows=4,094,800 width=74) (actual time=1,941.667..4,657.951 rows=4,059,951 loops=1)

  • Hash Cond: ((fr.id)::text = (factual_report_permission.factual_report_id)::text)
5. 1,202.289 2,790.272 ↑ 1.0 4,060,180 1

Hash Join (cost=133,144.04..240,364.22 rows=4,094,800 width=99) (actual time=1,120.093..2,790.272 rows=4,060,180 loops=1)

  • Hash Cond: ((factual_report_subscore.factual_report_id)::text = (fr.id)::text)
6. 475.323 475.323 ↑ 1.0 4,066,143 1

Seq Scan on factual_report_subscore (cost=0.00..96,470.83 rows=4,094,983 width=33) (actual time=0.007..475.323 rows=4,066,143 loops=1)

7. 628.523 1,112.660 ↓ 1.0 2,391,286 1

Hash (cost=103,266.25..103,266.25 rows=2,390,223 width=66) (actual time=1,112.660..1,112.660 rows=2,391,286 loops=1)

  • Buckets: 4194304 Batches: 1 Memory Usage: 275633kB
8. 484.137 484.137 ↓ 1.0 2,391,286 1

Seq Scan on factual_report fr (cost=0.00..103,266.25 rows=2,390,223 width=66) (actual time=0.013..484.137 rows=2,391,286 loops=1)

  • Filter: ((valid_to >= '2003-01-01 08:57:01'::timestamp without time zone) AND (valid_from <= '2019-10-22 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: 1518
9. 508.570 813.962 ↑ 1.0 2,392,746 1

Hash (cost=55,014.99..55,014.99 rows=2,409,839 width=25) (actual time=813.962..813.962 rows=2,392,746 loops=1)

  • Buckets: 4194304 Batches: 1 Memory Usage: 165958kB
10. 305.392 305.392 ↑ 1.0 2,392,746 1

Seq Scan on factual_report_permission (cost=0.00..55,014.99 rows=2,409,839 width=25) (actual time=0.019..305.392 rows=2,392,746 loops=1)

  • Filter: ((organization_id)::text = '59087ebe6acef17ef317c5c8'::text)
  • Rows Removed by Filter: 17265
Planning time : 2.663 ms
Execution time : 6,587.614 ms