explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZrZk

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 786.469 ↑ 1.1 87 1

Limit (cost=36,666.29..36,666.54 rows=100 width=576) (actual time=786.459..786.469 rows=87 loops=1)

2. 1.158 786.463 ↑ 287.6 87 1

Sort (cost=36,666.29..36,728.84 rows=25,022 width=576) (actual time=786.457..786.463 rows=87 loops=1)

  • Sort Key: "Banks"."Name", "Customers"."FullName
  • Sort Method: quicksort Memory: 104kB
3. 0.275 785.305 ↑ 287.6 87 1

Nested Loop (cost=26,161.10..35,709.96 rows=25,022 width=576) (actual time=247.304..785.305 rows=87 loops=1)

4. 0.018 0.018 ↑ 1.0 1 1

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

  • Filter: ("BankId" = 1)
5. 505.078 785.012 ↑ 287.6 87 1

Hash Right Join (cost=26,161.10..35,457.73 rows=25,022 width=566) (actual time=247.284..785.012 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. 38.305 38.305 ↓ 1.0 50,004 1

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

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

Hash (cost=21,922.05..21,922.05 rows=50,004 width=566) (actual time=176.103..176.103 rows=50,004 loops=1)

  • Buckets: 16384 Batches: 8 Memory Usage: 3837kB
8. 123.121 123.121 ↑ 1.0 50,004 1

Seq Scan on "Customers" (cost=0.00..21,922.05 rows=50,004 width=566) (actual time=0.046..123.121 rows=50,004 loops=1)

  • Filter: ("BankId" = 1)
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. 65.526 65.526 ↓ 0.0 0 1

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

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