explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U9IM

Settings
# exclusive inclusive rows x rows loops node
1. 5.965 7,239.141 ↓ 350.3 13,661 1

Group (cost=733,052.40..733,052.59 rows=39 width=40) (actual time=7,230.572..7,239.141 rows=13,661 loops=1)

  • Group Key: t1.company_id
2. 13.448 7,233.176 ↓ 752.1 29,332 1

Sort (cost=733,052.40..733,052.49 rows=39 width=8) (actual time=7,230.569..7,233.176 rows=29,332 loops=1)

  • Sort Key: t1.company_id
  • Sort Method: quicksort Memory: 2143kB
3. 554.198 7,219.728 ↓ 752.1 29,332 1

Subquery Scan on t1 (cost=698,771.72..733,051.36 rows=39 width=8) (actual time=6,257.034..7,219.728 rows=29,332 loops=1)

  • Filter: ((t1.current_amount <> t1.previous_amount) AND (t1.declared_date = '2019-08-07'::date))
  • Rows Removed by Filter: 1886426
4. 1,843.469 6,665.530 ↑ 1.0 1,915,758 1

Sort (cost=698,771.72..703,668.81 rows=1,958,837 width=53) (actual time=6,257.025..6,665.530 rows=1,915,758 loops=1)

  • Sort Key: dividends.date DESC
  • Sort Method: external merge Disk: 64176kB
5. 1,934.124 4,822.061 ↑ 1.0 1,915,758 1

WindowAgg (cost=320,971.17..360,147.91 rows=1,958,837 width=53) (actual time=2,428.011..4,822.061 rows=1,915,758 loops=1)

6. 2,448.845 2,887.937 ↑ 1.0 1,915,758 1

Sort (cost=320,971.17..325,868.27 rows=1,958,837 width=21) (actual time=2,427.995..2,887.937 rows=1,915,758 loops=1)

  • Sort Key: dividends.company_id, dividends.date DESC
  • Sort Method: external merge Disk: 51136kB
7. 439.092 439.092 ↑ 1.0 1,915,758 1

Seq Scan on dividends (cost=0.00..35,911.37 rows=1,958,837 width=21) (actual time=0.032..439.092 rows=1,915,758 loops=1)

Planning time : 0.133 ms