explain.depesz.com

PostgreSQL's explain analyze made readable

Result: S7JG : Optimization for: Optimization for: plan #KUau; plan #2rfR

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 1,680.528 ↓ 0.0 0 1

HashAggregate (cost=114,580.95..114,581.49 rows=36 width=55) (actual time=1,680.528..1,680.528 rows=0 loops=1)

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

Gather (cost=109,406.20..114,580.50 rows=36 width=55) (actual time=1,680.526..1,680.526 rows=0 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 0.002 1,495.890 ↓ 0.0 0 2

Nested Loop (cost=108,406.20..113,576.83 rows=21 width=55) (actual time=1,495.890..1,495.890 rows=0 loops=2)

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

Hash Join (cost=108,405.64..113,514.99 rows=19 width=31) (actual time=1,495.888..1,495.888 rows=0 loops=2)

  • Hash Cond: ((("CaseReview6"."countyNo")::smallint = ("Review7"."countyNo")::smallint) AND (("CaseReview6"."reviewSeqNo")::integer = ("Review7"."seqNo")::integer))
5. 0.009 0.009 ↑ 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.009..0.009 rows=1 loops=2)

6. 0.000 1,495.814 ↓ 0.0 0 2

Hash (cost=108,403.36..108,403.36 rows=152 width=6) (actual time=1,495.814..1,495.814 rows=0 loops=2)

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

Hash Right Join (cost=46,882.18..108,403.36 rows=152 width=6) (actual time=1,495.814..1,495.814 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: 1536386
8. 266.791 266.791 ↓ 1.0 1,102,418 2

Seq Scan on "ReviewMessage" "ReviewMessage9" (cost=0.00..28,173.15 rows=1,102,415 width=21) (actual time=0.018..266.791 rows=1,102,418 loops=2)

9. 371.957 661.983 ↓ 1.0 1,359,528 2

Hash (cost=26,489.27..26,489.27 rows=1,359,527 width=21) (actual time=661.983..661.983 rows=1,359,528 loops=2)

  • Buckets: 2097152 Batches: 1 Memory Usage: 91598kB
10. 290.026 290.026 ↓ 1.0 1,359,528 2

Seq Scan on "Review" "Review7" (cost=0.00..26,489.27 rows=1,359,527 width=21) (actual time=0.015..290.026 rows=1,359,528 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