explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DNxf

Settings
# exclusive inclusive rows x rows loops node
1. 34.243 4,659.469 ↓ 1.3 542 1

Gather (cost=91,996.91..183,432.37 rows=406 width=24) (actual time=4,452.015..4,659.469 rows=542 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 97.536 4,625.226 ↓ 1.1 181 3

Nested Loop (cost=90,996.91..182,391.77 rows=169 width=24) (actual time=4,438.723..4,625.226 rows=181 loops=3)

3. 117.274 4,527.154 ↓ 22.6 181 3

Parallel Hash Join (cost=90,996.47..181,837.56 rows=8 width=16) (actual time=4,436.996..4,527.154 rows=181 loops=3)

  • Hash Cond: ((a.company_id = b.company_id) AND ((a.quarter - 10) = b.quarter))
  • Join Filter: ((((a.diff_data ->> '121000'::text))::bigint > ((b.diff_data ->> '121000'::text))::bigint) AND (((a.diff_data ->> '125000'::text))::bigint > ((b.diff_data ->> '125000'::text))::bigint) AND (((((a.diff_data ->> '125000'::text) || '0'::text))::numeric / ((((a.diff_data ->> '121000'::text) || '0'::text))::bigint)::numeric) > (((b.diff_data ->> '125000'::text))::numeric / (((b.diff_data ->> '121000'::text))::bigint)::numeric)))
  • Rows Removed by Join Filter: 334
4. 694.161 694.161 ↑ 1.3 547 3

Parallel Seq Scan on financial_statement a (cost=0.00..88,537.27 rows=685 width=379) (actual time=2.476..694.161 rows=547 loops=3)

  • Filter: ((announced >= '2016-04-01 00:00:00+00'::timestamp with time zone) AND (announced <= '2016-05-31 00:00:00+00'::timestamp with time zone) AND ((diff_data ->> '121000'::text) <> ''::text) AND ((diff_data ->> '125000'::text) <> ''::text))
  • Rows Removed by Filter: 33875
5. 107.595 3,715.719 ↑ 1.3 31,701 3

Parallel Hash (cost=88,326.02..88,326.02 rows=41,830 width=371) (actual time=3,715.719..3,715.719 rows=31,701 loops=3)

  • Buckets: 16384 Batches: 16 Memory Usage: 2720kB
6. 3,608.124 3,608.124 ↑ 1.3 31,701 3

Parallel Seq Scan on financial_statement b (cost=0.00..88,326.02 rows=41,830 width=371) (actual time=0.072..3,608.124 rows=31,701 loops=3)

  • Filter: (((diff_data ->> '121000'::text) <> ''::text) AND ((diff_data ->> '125000'::text) <> ''::text))
  • Rows Removed by Filter: 2721
7. 0.536 0.536 ↑ 23.0 1 544

Index Scan using stock_price_company_id_and_date on stock_price (cost=0.44..69.05 rows=23 width=24) (actual time=0.534..0.536 rows=1 loops=544)

  • Index Cond: ((company_id = a.company_id) AND (date = make_date((date_part('year'::text, a.announced))::integer, 5, 31)))
  • Filter: (end_price IS NOT NULL)
Planning time : 11.434 ms
Execution time : 4,659.902 ms