explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2rfR : Optimization for: plan #KUau

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.004 1,525.240 ↓ 0.0 0 1

HashAggregate (cost=114,598.85..114,599.41 rows=37 width=55) (actual time=1,525.240..1,525.240 rows=0 loops=1)

  • Group Key: "CaseReview6"."reviewSeqNo", "CaseReview6".xmin, "CaseReview6"."caseNo", "CaseReview6"."countyNo", (("CaseReview6".ctid)::character varying)
2. 109.431 1,525.236 ↓ 0.0 0 1

Gather (cost=109,423.98..114,598.39 rows=37 width=55) (actual time=1,525.236..1,525.236 rows=0 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 0.008 1,415.805 ↓ 0.0 0 2

Nested Loop (cost=108,423.98..113,594.61 rows=22 width=55) (actual time=1,415.805..1,415.805 rows=0 loops=2)

  • Join Filter: (("Review7"."countyNo")::smallint = ("Case8"."countyNo")::smallint)
4. 0.075 1,415.797 ↓ 0.0 0 2

Hash Join (cost=108,423.42..113,532.78 rows=19 width=31) (actual time=1,415.797..1,415.797 rows=0 loops=2)

  • Hash Cond: ((("CaseReview6"."countyNo")::smallint = ("Review7"."countyNo")::smallint) AND (("CaseReview6"."reviewSeqNo")::integer = ("Review7"."seqNo")::integer))
5. 0.010 0.010 ↑ 153,163.0 1 2

Parallel Seq Scan on "CaseReview" "CaseReview6" (cost=0.00..3,194.63 rows=153,163 width=29) (actual time=0.010..0.010 rows=1 loops=2)

6. 0.000 1,415.712 ↓ 0.0 0 2

Hash (cost=108,421.09..108,421.09 rows=155 width=6) (actual time=1,415.712..1,415.712 rows=0 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
7. 502.599 1,415.712 ↓ 0.0 0 2

Hash Right Join (cost=46,881.80..108,421.09 rows=155 width=6) (actual time=1,415.712..1,415.712 rows=0 loops=2)

  • Hash Cond: ((("ReviewMessage9"."countyNo")::smallint = ("Review7"."countyNo")::smallint) AND (("ReviewMessage9"."reviewSeqNo")::integer = ("Review7"."seqNo")::integer))
  • Filter: (((("Review7".sender)::text = 'FBOYLE'::text) OR (("ReviewMessage9".sender)::text = 'FBOYLE'::text)) AND (((("Review7"."sentWhen")::timestamp without time zone >= '2018-11-26 00:00:00'::timestamp without time zone) AND (("Review7"."sentWhen")::timestamp without time zone <= '2018-12-26 23:59:59.999'::timestamp without time zone)) OR ((("ReviewMessage9"."sentWhen")::timestamp without time zone >= '2018-11-26 00:00:00'::timestamp without time zone) AND (("ReviewMessage9"."sentWhen")::timestamp without time zone <= '2018-12-26 23:59:59.999'::timestamp without time zone))))
  • Rows Removed by Filter: 1536360
8. 266.663 266.663 ↑ 1.0 1,102,397 2

Seq Scan on "ReviewMessage" "ReviewMessage9" (cost=0.00..28,177.65 rows=1,102,865 width=21) (actual time=0.023..266.663 rows=1,102,397 loops=2)

9. 358.003 646.450 ↑ 1.0 1,359,512 2

Hash (cost=26,489.12..26,489.12 rows=1,359,512 width=21) (actual time=646.450..646.450 rows=1,359,512 loops=2)

  • Buckets: 2097152 Batches: 1 Memory Usage: 91597kB
10. 288.447 288.447 ↑ 1.0 1,359,512 2

Seq Scan on "Review" "Review7" (cost=0.00..26,489.12 rows=1,359,512 width=21) (actual time=0.022..288.447 rows=1,359,512 loops=2)

11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using "Case_caseNo" on "Case" "Case8" (cost=0.56..3.24 rows=1 width=15) (never executed)

  • Index Cond: (("caseNo" = ("CaseReview6"."caseNo")::text) AND ("countyNo" = ("CaseReview6"."countyNo")::smallint))
  • Heap Fetches: 0