explain.depesz.com

PostgreSQL's explain analyze made readable

Result: N6Cf

Settings
# exclusive inclusive rows x rows loops node
1. 0.054 2,193.783 ↑ 1.2 81 1

Limit (cost=0.83..1,213.90 rows=100 width=15) (actual time=56.762..2,193.783 rows=81 loops=1)

2. 0.151 2,193.729 ↑ 309.2 81 1

Nested Loop (cost=0.83..303,851.62 rows=25,048 width=15) (actual time=56.760..2,193.729 rows=81 loops=1)

  • Join Filter: ("Customers"."BankId" = "Banks"."BankId")
3. 1,952.762 2,193.497 ↑ 309.2 81 1

Nested Loop Left Join (cost=0.83..303,473.89 rows=25,048 width=19) (actual time=56.721..2,193.497 rows=81 loops=1)

  • Filter: ((to_tsvector('simple'::regconfig, f_concat_ws(' '::text, VARIADIC ARRAY[("Customers"."CustomerNumber")::text, ("Customers"."TaxId")::text, ("Customers"."FullName")::text])) @@ '''michael'''::tsquery) OR (to_tsvector('simple'::regconfig, f_concat_ws(' '::text, VARIADIC ARRAY[("CustomerAddresses"."EmailAddress1")::text, ("CustomerAddresses"."EmailAddress2")::text, ("CustomerAddresses"."HomePhone")::text, ("CustomerAddresses"."WorkPhone")::text, ("CustomerAddresses"."MobilePhone")::text])) @@ '''michael'''::tsquery) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Rows Removed by Filter: 49923
4. 39.904 39.904 ↑ 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.102..39.904 rows=50,004 loops=1)

  • Heap Fetches: 5
5. 150.012 150.012 ↑ 1.0 1 50,004

Index Only Scan using idx_customeraddresses_covering2 on "CustomerAddresses" (cost=0.41..0.51 rows=1 width=104) (actual time=0.003..0.003 rows=1 loops=50,004)

  • Index Cond: ("CustomerId" = "Customers"."CustomerId")
  • Heap Fetches: 0
6.          

SubPlan (forNested Loop Left Join)

7. 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
8. 50.819 50.819 ↓ 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=50.819..50.819 rows=0 loops=1)

  • Filter: (("AccountNumber")::text ~~ '%michael%'::text)
  • Rows Removed by Filter: 171714
  • Heap Fetches: 0
9. 0.060 0.081 ↑ 1.0 1 81

Materialize (cost=0.00..2.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=81)

10. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on "Banks" (cost=0.00..2.01 rows=1 width=4) (actual time=0.021..0.021 rows=1 loops=1)

Planning time : 2.273 ms