explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Dviu : Optimization for: plan #WwJ2

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.006 413.497 ↑ 1.0 1 1

Aggregate (cost=72,297.32..72,297.34 rows=1 width=4) (actual time=413.497..413.497 rows=1 loops=1)

2. 177.705 413.491 ↑ 19,313.5 2 1

Hash Right Join (cost=35,373.97..72,200.76 rows=38,627 width=0) (actual time=405.849..413.491 rows=2 loops=1)

  • Hash Cond: (t0."TicketID" = t."ID")
  • Filter: ((t."AgentPersonID" = '2f9d398a-7847-11ea-bce8-56fc329cd4d1'::uuid) OR (t0."ExcavatorContactID" = 'ea56d556-1504-e311-aac5-000c2904053c'::uuid) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Rows Removed by Filter: 76,884
3. 193.231 193.231 ↑ 1.0 578,085 1

Seq Scan on "TicketExcavators" t0 (cost=0.00..26,868.85 rows=578,085 width=32) (actual time=0.039..193.231 rows=578,085 loops=1)

4. 16.063 42.527 ↑ 1.0 76,886 1

Hash (cost=33,880.52..33,880.52 rows=77,236 width=32) (actual time=42.527..42.527 rows=76,886 loops=1)

  • Buckets: 65,536 Batches: 2 Memory Usage: 2,901kB
5. 21.855 26.464 ↑ 1.0 76,886 1

Bitmap Heap Scan on "Tickets" t (cost=1,644.38..33,880.52 rows=77,236 width=32) (actual time=5.060..26.464 rows=76,886 loops=1)

  • Recheck Cond: (("TakenEndDate" >= '2020-05-31 00:00:00-04'::timestamp with time zone) AND ("TakenEndDate" < '2020-07-01 00:00:00-04'::timestamp with time zone))
  • Filter: (("TicketTypeID" <> '9084e88d-25bb-4f8a-9a2a-9a0801136044'::uuid) OR ("TicketTypeID" IS NULL))
  • Rows Removed by Filter: 20
  • Heap Blocks: exact=4,648
6. 4.609 4.609 ↑ 1.0 76,906 1

Bitmap Index Scan on "IX_Tickets_TakenEndDate" (cost=0.00..1,625.08 rows=77,265 width=0) (actual time=4.608..4.609 rows=76,906 loops=1)

  • Index Cond: (("TakenEndDate" >= '2020-05-31 00:00:00-04'::timestamp with time zone) AND ("TakenEndDate" < '2020-07-01 00:00:00-04'::timestamp with time zone))
7.          

SubPlan (for Hash Right Join)

8. 0.000 0.000 ↓ 0.0 0

Index Scan using "IX_TicketSiteContacts_TicketID" on "TicketSiteContacts" t1 (cost=0.42..8.45 rows=1 width=0) (never executed)

  • Index Cond: ("TicketID" = t."ID")
  • Filter: ("ExcavatorContactID" = 'ea56d556-1504-e311-aac5-000c2904053c'::uuid)
9. 0.013 0.028 ↑ 3.8 12 1

Bitmap Heap Scan on "TicketSiteContacts" t1_1 (cost=4.77..175.27 rows=45 width=16) (actual time=0.020..0.028 rows=12 loops=1)

  • Recheck Cond: ("ExcavatorContactID" = 'ea56d556-1504-e311-aac5-000c2904053c'::uuid)
  • Heap Blocks: exact=12
10. 0.015 0.015 ↑ 3.8 12 1

Bitmap Index Scan on "IX_TicketSiteContacts_ExcavatorContactID" (cost=0.00..4.76 rows=45 width=0) (actual time=0.015..0.015 rows=12 loops=1)

  • Index Cond: ("ExcavatorContactID" = 'ea56d556-1504-e311-aac5-000c2904053c'::uuid)
Planning time : 0.718 ms
Execution time : 414.063 ms