explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0JbY

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 505.089 ↑ 1.1 87 1

Limit (cost=8,421.89..8,422.14 rows=100 width=25) (actual time=505.082..505.089 rows=87 loops=1)

2. 0.348 505.084 ↑ 287.6 87 1

Sort (cost=8,421.89..8,484.44 rows=25,022 width=25) (actual time=505.080..505.084 rows=87 loops=1)

  • Sort Key: "Banks"."Name", "Customers"."FullName
  • Sort Method: quicksort Memory: 31kB
3. 0.130 504.736 ↑ 287.6 87 1

Nested Loop (cost=3,032.15..7,465.57 rows=25,022 width=25) (actual time=98.213..504.736 rows=87 loops=1)

  • Join Filter: ("Customers"."BankId" = "Banks"."BankId")
4. 0.015 0.015 ↑ 1.0 1 1

Seq Scan on "Banks" (cost=0.00..2.01 rows=1 width=14) (actual time=0.014..0.015 rows=1 loops=1)

5. 391.951 504.591 ↑ 287.6 87 1

Hash Right Join (cost=3,032.15..7,150.78 rows=25,022 width=19) (actual time=98.195..504.591 rows=87 loops=1)

  • Hash Cond: ("CustomerAddresses"."CustomerId" = "Customers"."CustomerId")
  • Filter: ((lower(("Customers"."CustomerNumber")::text) ~~ '%michael%'::text) OR (("Customers"."TaxId")::text ~~ '%michael%'::text) OR (lower(("Customers"."FullName")::text) ~~ '%michael%'::text) OR (lower(("CustomerAddresses"."EmailAddress1")::text) ~~ '%michael%'::text) OR (lower(("CustomerAddresses"."EmailAddress2")::text) ~~ '%michael%'::text) OR (lower(("CustomerAddresses"."HomePhone")::text) ~~ '%michael%'::text) OR (lower(("CustomerAddresses"."WorkPhone")::text) ~~ '%michael%'::text) OR (lower(("CustomerAddresses"."MobilePhone")::text) ~~ '%michael%'::text) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Rows Removed by Filter: 49917
6. 19.143 19.143 ↓ 1.0 50,004 1

Seq Scan on "CustomerAddresses" (cost=0.00..3,967.06 rows=50,003 width=104) (actual time=0.018..19.143 rows=50,004 loops=1)

  • Filter: ("AddressIndex" = 0)
  • Rows Removed by Filter: 1
7. 16.399 45.305 ↑ 1.0 50,004 1

Hash (cost=2,407.10..2,407.10 rows=50,004 width=37) (actual time=45.305..45.305 rows=50,004 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 4060kB
8. 28.906 28.906 ↑ 1.0 50,004 1

Index Only Scan using idx_customers_covering2 on "Customers" (cost=0.41..2,407.10 rows=50,004 width=37) (actual time=0.175..28.906 rows=50,004 loops=1)

  • Heap Fetches: 5
9.          

SubPlan (forHash Right Join)

10. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on "CustomerRelationships" (cost=4.45..20.26 rows=1 width=0) (never executed)

  • Recheck Cond: ("CustomerId" = "Customers"."CustomerId")
  • Filter: (("AccountNumber")::text ~~ '%michael%'::text)
11. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_customerrelationships_customerid (cost=0.00..4.45 rows=4 width=0) (never executed)

  • Index Cond: ("CustomerId" = "Customers"."CustomerId")
12. 48.192 48.192 ↓ 0.0 0 1

Seq Scan on "CustomerRelationships" "CustomerRelationships_1" (cost=0.00..11,486.42 rows=17 width=4) (actual time=48.192..48.192 rows=0 loops=1)

  • Filter: (("AccountNumber")::text ~~ '%michael%'::text)
  • Rows Removed by Filter: 171714
Planning time : 1.374 ms