explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ziC5

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

Limit (cost=36,666.28..36,666.53 rows=100 width=574) (actual time=847.341..847.351 rows=87 loops=1)

2. 1.163 847.346 ↑ 287.6 87 1

Sort (cost=36,666.28..36,728.84 rows=25,022 width=574) (actual time=847.339..847.346 rows=87 loops=1)

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

Nested Loop (cost=26,161.10..35,709.96 rows=25,022 width=574) (actual time=289.625..846.183 rows=87 loops=1)

4. 0.016 0.016 ↑ 1.0 1 1

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

  • Filter: ("BankId" = 1)
5. 539.778 845.983 ↑ 287.6 87 1

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

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

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

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

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

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

Seq Scan on "CustomerRelationships" "CustomerRelationships_1" (cost=0.00..10,744.44 rows=11 width=4) (actual time=48.846..48.846 rows=0 loops=1)

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