explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zwWrJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 1,485.147 ↑ 1.2 81 1

Limit (cost=36,668.36..36,668.61 rows=100 width=575) (actual time=1,485.139..1,485.147 rows=81 loops=1)

2. 0.923 1,485.136 ↑ 309.3 81 1

Sort (cost=36,668.36..36,731.00 rows=25,055 width=575) (actual time=1,485.134..1,485.136 rows=81 loops=1)

  • Sort Key: "Banks"."Name", "Customers"."FullName
  • Sort Method: quicksort Memory: 99kB
3. 0.170 1,484.213 ↑ 309.3 81 1

Nested Loop (cost=26,161.10..35,710.78 rows=25,055 width=575) (actual time=398.981..1,484.213 rows=81 loops=1)

4. 0.035 0.035 ↑ 1.0 1 1

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

  • Filter: ("BankId" = 1)
5. 1,025.208 1,484.008 ↑ 309.3 81 1

Hash Right Join (cost=26,161.10..35,458.22 rows=25,055 width=565) (actual time=398.945..1,484.008 rows=81 loops=1)

  • Hash Cond: ("CustomerAddresses"."CustomerId" = "Customers"."CustomerId")
  • Filter: ((to_tsvector('simple'::regconfig, f_concat_ws(' '::text, VARIADIC ARRAY[("Customers"."CustomerNumber")::text, ("Customers"."TaxId")::text, ("Customers"."FullName")::text])) @@ '''michael'''::tsquery) 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: 49923
6. 68.774 68.774 ↓ 1.0 50,004 1

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

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

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

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

Seq Scan on "Customers" (cost=0.00..21,922.05 rows=50,004 width=565) (actual time=0.058..171.446 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. 166.568 166.568 ↓ 0.0 0 1

Seq Scan on "CustomerRelationships" "CustomerRelationships_1" (cost=0.00..10,881.11 rows=12 width=4) (actual time=166.568..166.568 rows=0 loops=1)

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