explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eJUp

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 715.222 ↑ 1.1 87 1

Limit (cost=8,468.58..8,468.83 rows=100 width=25) (actual time=715.211..715.222 rows=87 loops=1)

2. 0.425 715.215 ↑ 287.6 87 1

Sort (cost=8,468.58..8,531.14 rows=25,022 width=25) (actual time=715.210..715.215 rows=87 loops=1)

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

Nested Loop (cost=3,157.16..7,512.26 rows=25,022 width=25) (actual time=92.827..714.790 rows=87 loops=1)

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)

  • Filter: ("BankId" = 1)
5. 553.059 714.712 ↑ 287.6 87 1

Hash Right Join (cost=3,157.16..7,260.03 rows=25,022 width=19) (actual time=92.810..714.712 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. 74.078 74.078 ↓ 1.0 50,004 1

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

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

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

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

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

  • Index Cond: ("BankId" = 1)
  • Heap Fetches: 5
9.          

SubPlan (forHash Right Join)

10. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_customerrelationships_covering2 on "CustomerRelationships" (cost=0.42..4.50 rows=1 width=0) (never executed)

  • Index Cond: ("CustomerId" = "Customers"."CustomerId")
  • Filter: (("AccountNumber")::text ~~ '%michael%'::text)
  • Heap Fetches: 0
11. 42.575 42.575 ↓ 0.0 0 1

Index Only Scan using idx_customerrelationships_covering2 on "CustomerRelationships" "CustomerRelationships_1" (cost=0.42..6,345.42 rows=17 width=4) (actual time=42.575..42.575 rows=0 loops=1)

  • Filter: (("AccountNumber")::text ~~ '%michael%'::text)
  • Rows Removed by Filter: 171714
  • Heap Fetches: 0
Planning time : 1.059 ms