explain.depesz.com

PostgreSQL's explain analyze made readable

Result: s6Cs

Settings
# exclusive inclusive rows x rows loops node
1. 0.065 6,144.500 ↑ 1.0 1 1

GroupAggregate (cost=54,175.67..54,175.71 rows=1 width=36) (actual time=6,144.499..6,144.500 rows=1 loops=1)

  • Group Key: (min((cth."HOLDING_ID")::text))
2. 0.140 6,144.435 ↓ 28.8 115 1

Sort (cost=54,175.67..54,175.68 rows=4 width=36) (actual time=6,144.378..6,144.435 rows=115 loops=1)

  • Sort Key: (min((cth."HOLDING_ID")::text))
  • Sort Method: quicksort Memory: 30kB
3. 3.152 6,144.295 ↓ 28.8 115 1

Nested Loop (cost=53,835.58..54,175.63 rows=4 width=36) (actual time=6,137.086..6,144.295 rows=115 loops=1)

  • Join Filter: ((e."ID")::text = ANY (((min(tv."EVENTS_IDS")))::text[]))
  • Rows Removed by Join Filter: 4813
4. 0.000 6,138.602 ↓ 77.0 77 1

Finalize GroupAggregate (cost=53,835.58..54,169.21 rows=1 width=97) (actual time=6,137.031..6,138.602 rows=77 loops=1)

  • Group Key: tv."TEXT_ID
  • Filter: ((min((cth."HOLDING_ID")::text) IS NULL) AND (count(*) = 1))
  • Rows Removed by Filter: 104
5. 26.107 6,158.905 ↑ 9.4 230 1

Gather Merge (cost=53,835.58..54,109.70 rows=2,164 width=105) (actual time=6,136.984..6,158.905 rows=230 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 0.765 6,132.798 ↑ 14.1 77 3 / 3

Partial GroupAggregate (cost=52,835.55..52,859.90 rows=1,082 width=105) (actual time=6,132.014..6,132.798 rows=77 loops=3)

  • Group Key: tv."TEXT_ID
7. 1.332 6,132.033 ↑ 2.0 547 3 / 3

Sort (cost=52,835.55..52,838.26 rows=1,082 width=101) (actual time=6,131.769..6,132.033 rows=547 loops=3)

  • Sort Key: tv."TEXT_ID
  • Sort Method: quicksort Memory: 110kB
  • Worker 0: Sort Method: quicksort Memory: 96kB
  • Worker 1: Sort Method: quicksort Memory: 100kB
8. 1.085 6,130.701 ↑ 2.0 547 3 / 3

Hash Left Join (cost=457.62..52,781.02 rows=1,082 width=101) (actual time=287.979..6,130.701 rows=547 loops=3)

  • Hash Cond: ((tti."INDUSTRY_ID" = cti."INDUSTRY_ID") AND ((tv."COMPANY_ID")::text = (cti."COMPANY_ID")::text))
9. 383.499 6,128.102 ↑ 2.0 547 3 / 3

Nested Loop (cost=407.37..52,722.54 rows=1,082 width=102) (actual time=286.380..6,128.102 rows=547 loops=3)

10. 793.272 866.624 ↓ 152.7 609,747 3 / 3

Parallel Bitmap Heap Scan on "TEXT_VIEW" tv (cost=406.82..36,074.91 rows=3,994 width=98) (actual time=248.496..866.624 rows=609,747 loops=3)

  • Recheck Cond: (("TEXT_DATE" >= '2020-01-01 00:00:00'::timestamp without time zone) AND ("TEXT_DATE" <= '2020-02-11 00:00:00'::timestamp without time zone) AND (("TEXT_TO_COMPANY_ID")::text = ("MASTER_GUID")::text))
  • Heap Blocks: exact=33725
11. 73.352 73.352 ↓ 190.8 1,829,242 1 / 3

Bitmap Index Scan on "IDX_TEXT_VIEW_TEXT_TO_COMP_ID_MASTER_GUID" (cost=0.00..404.42 rows=9,586 width=0) (actual time=220.054..220.055 rows=1,829,242 loops=1)

  • Index Cond: (("TEXT_DATE" >= '2020-01-01 00:00:00'::timestamp without time zone) AND ("TEXT_DATE" <= '2020-02-11 00:00:00'::timestamp without time zone))
12. 4,877.979 4,877.979 ↓ 0.0 0 1,829,242 / 3

Index Only Scan using "PK_TEXT_TO_INDUSTRY" on "TEXT_TO_INDUSTRY" tti (cost=0.55..4.17 rows=1 width=37) (actual time=0.008..0.008 rows=0 loops=1,829,242)

  • Index Cond: (("INDUSTRY_ID" = 2) AND ("TEXT_ID" = (tv."TEXT_ID")::text))
  • Heap Fetches: 1640
13. 0.138 1.514 ↑ 1.0 215 3 / 3

Hash (cost=47.03..47.03 rows=215 width=65) (actual time=1.514..1.514 rows=215 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
14. 0.579 1.376 ↑ 1.0 215 3 / 3

Hash Join (cost=24.98..47.03 rows=215 width=65) (actual time=0.946..1.376 rows=215 loops=3)

  • Hash Cond: ((cth."COMPANY_ID")::text = (cti."COMPANY_ID")::text)
15. 0.468 0.468 ↓ 1.0 875 3 / 3

Seq Scan on "COMPANY_TO_HOLDING" cth (cost=0.00..19.74 rows=874 width=61) (actual time=0.018..0.468 rows=875 loops=3)

16. 0.125 0.329 ↑ 1.0 215 3 / 3

Hash (cost=22.30..22.30 rows=215 width=28) (actual time=0.328..0.329 rows=215 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
17. 0.204 0.204 ↑ 1.0 215 3 / 3

Seq Scan on "COMPANY_TO_INDUSTRY" cti (cost=0.00..22.30 rows=215 width=28) (actual time=0.080..0.204 rows=215 loops=3)

  • Filter: (("INDUSTRY_ID" = 2) AND ("INDUSTRY_ID" = ANY ('{2,18,19,14}'::integer[])))
  • Rows Removed by Filter: 660
18. 2.541 2.541 ↑ 1.2 64 77

Seq Scan on "EVENTS" e (cost=0.00..4.74 rows=74 width=6) (actual time=0.001..0.033 rows=64 loops=77)

Planning time : 1.000 ms
Execution time : 6,165.642 ms