explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aSzW

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2,061.155 ↓ 0.0 0 1

Nested Loop (cost=0.86..1,039,584.71 rows=1,152 width=664) (actual time=2,061.155..2,061.155 rows=0 loops=1)

  • Output: client0_.clientid, client0_.created, client0_.updated, client0_.agreetermdate, client0_.agreetermexpiredate, client0_.agreetermflag, client0_.agreetermpropose, client0_.basicstandardid, client0_.discountid, client0_.externalid, client0_.flag_lock, client0_.mobilephone, client0_.oldclientadddata, client0_.password, client0_.registrationclientid, (SubPlan 1), (SubPlan 2), (SubPlan 3), (SubPlan 5), (SubPlan 6), (SubPlan 8)
  • Buffers: shared hit=2,751,248
2. 232.001 2,061.153 ↓ 0.0 0 1

Index Scan using clientcustomercategory_enddate_idx on public.clientcustomercategory clientcust1_ (cost=0.43..986,857.11 rows=1,152 width=4) (actual time=2,061.153..2,061.153 rows=0 loops=1)

  • Output: clientcust1_.clientcustomercategoryid, clientcust1_.created, clientcust1_.updated, clientcust1_.enddate, clientcust1_.clientid, clientcust1_.customercategoryid
  • Index Cond: (clientcust1_.enddate <= '2020-06-29 00:00:00'::timestamp without time zone)
  • Filter: (clientcust1_.created = (SubPlan 9))
  • Rows Removed by Filter: 228,644
  • Buffers: shared hit=2,751,248
3.          

SubPlan (for Index Scan)

4. 228.644 1,829.152 ↑ 1.0 1 228,644

Aggregate (cost=4.24..4.25 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=228,644)

  • Output: max(ccc.created)
  • Buffers: shared hit=2,563,243
5. 1,600.508 1,600.508 ↓ 1.5 9 228,644

Index Scan using clientcustomercategory_clientid_idx1 on public.clientcustomercategory ccc (cost=0.43..4.23 rows=6 width=8) (actual time=0.003..0.007 rows=9 loops=228,644)

  • Output: ccc.clientcustomercategoryid, ccc.created, ccc.updated, ccc.enddate, ccc.clientid, ccc.customercategoryid
  • Index Cond: (ccc.clientid = clientcust1_.clientid)
  • Buffers: shared hit=2,563,243
6. 0.000 0.000 ↓ 0.0 0

Index Scan using client_pkey on public.client client0_ (cost=0.43..2.46 rows=1 width=92) (never executed)

  • Output: client0_.clientid, client0_.created, client0_.updated, client0_.agreetermdate, client0_.agreetermexpiredate, client0_.agreetermflag, client0_.agreetermpropose, client0_.basicstandardid, client0_.discountid, client0_.externalid, client0_.flag_lock, client0_.mobilephone, client0_.oldclientadddata, client0_.password, client0_.registrationclientid
  • Index Cond: (client0_.clientid = clientcust1_.clientid)
7.          

SubPlan (for Nested Loop)

8. 0.000 0.000 ↓ 0.0 0

Subquery Scan on ccb (cost=0.42..20.04 rows=16 width=32) (never executed)

  • Output: ccb.balance
9. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=0.42..19.88 rows=16 width=36) (never executed)

  • Output: COALESCE(sum(clientbalance.balance), '0'::numeric), clientbalance.clientid
  • Group Key: clientbalance.clientid
10. 0.000 0.000 ↓ 0.0 0

Index Scan using clientbalance_clientid_idx on public.clientbalance (cost=0.42..19.60 rows=16 width=9) (never executed)

  • Output: clientbalance.clientid, clientbalance.balance
  • Index Cond: (clientbalance.clientid = client0_.clientid)
  • Filter: clientbalance.isactive
11. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2.37..2.38 rows=1 width=8) (never executed)

  • Output: count(bl.blacklistid)
12. 0.000 0.000 ↓ 0.0 0

Index Scan using blacklist_clientid_idx on public.blacklist bl (cost=0.14..2.36 rows=1 width=4) (never executed)

  • Output: bl.blacklistid, bl.comment, bl.reasonid, bl.clientid
  • Index Cond: (bl.clientid = client0_.clientid)
13. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2.37..2.38 rows=1 width=8) (never executed)

  • Output: count(wl.whitelistid)
14. 0.000 0.000 ↓ 0.0 0

Index Scan using whitelist_clientid_idx on public.whitelist wl (cost=0.14..2.36 rows=1 width=4) (never executed)

  • Output: wl.whitelistid, wl.comment, wl.reasonid, wl.clientid
  • Index Cond: (wl.clientid = client0_.clientid)
15. 0.000 0.000 ↓ 0.0 0

Limit (cost=4.03..7.19 rows=1 width=4) (never executed)

  • Output: csh.clientstatus
16.          

Initplan (for Limit)

17. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=3.59..3.60 rows=1 width=8) (never executed)

  • Output: max(cshmax.created)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using clientstatushistory_clientid_idx on public.clientstatushistory cshmax (cost=0.43..3.58 rows=3 width=8) (never executed)

  • Output: cshmax.clientstatushistoryid, cshmax.created, cshmax.updated, cshmax.clientstatus, cshmax.enddate, cshmax.clientid
  • Index Cond: (cshmax.clientid = client0_.clientid)
19. 0.000 0.000 ↓ 0.0 0

Index Scan using clientstatushistory_clientid_idx on public.clientstatushistory csh (cost=0.43..3.59 rows=1 width=4) (never executed)

  • Output: csh.clientstatus
  • Index Cond: (csh.clientid = client0_.clientid)
  • Filter: (csh.created = $5)
20. 0.000 0.000 ↓ 0.0 0

Limit (cost=1.28..6.01 rows=1 width=6) (never executed)

  • Output: a.timezone
21. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.28..10.74 rows=2 width=6) (never executed)

  • Output: a.timezone
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using client_pkey on public.client cl (cost=0.43..2.65 rows=1 width=4) (never executed)

  • Output: cl.clientid
  • Index Cond: (cl.clientid = client0_.clientid)
  • Heap Fetches: 0
23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..8.07 rows=2 width=10) (never executed)

  • Output: a.timezone, p.clientid
24. 0.000 0.000 ↓ 0.0 0

Index Scan using person_clientid_idx on public.person p (cost=0.43..2.76 rows=2 width=8) (never executed)

  • Output: p.personid, p.created, p.updated, p.inn, p.snils, p.bankrupt, p.birthdate, p.childrennumber, p.childrennumberlt21, p.citizenship, p.court, p.dependecesnumber, p.educationtype, p.gender, p.maritalstatus, p.name, p.patronymic, p.surname, p.addresslivingid, p.addressregistrationid, p.clientid, p.personemailid
  • Index Cond: (p.clientid = client0_.clientid)
25. 0.000 0.000 ↓ 0.0 0

Index Scan using address_pkey on public.address a (cost=0.43..2.65 rows=1 width=10) (never executed)

  • Output: a.addressid, a.created, a.updated, a.building, a.city, a.corp, a.country, a.flat, a.fulladdress, a.house, a.postalcode, a.region, a.settlement, a.street, a.timezone
  • Index Cond: (a.addressid = p.addresslivingid)
26. 0.000 0.000 ↓ 0.0 0

Limit (cost=3.08..5.31 rows=1 width=4) (never executed)

  • Output: cth.clienttype
27.          

Initplan (for Limit)

28. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2.65..2.66 rows=1 width=8) (never executed)

  • Output: max(cthmax.created)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using clienttypehistory_clientid_idx on public.clienttypehistory cthmax (cost=0.43..2.65 rows=1 width=8) (never executed)

  • Output: cthmax.clienttypehistoryid, cthmax.created, cthmax.updated, cthmax.clienttype, cthmax.enddate, cthmax.clientid
  • Index Cond: (cthmax.clientid = client0_.clientid)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using clienttypehistory_clientid_idx on public.clienttypehistory cth (cost=0.43..2.65 rows=1 width=4) (never executed)

  • Output: cth.clienttype
  • Index Cond: (cth.clientid = client0_.clientid)
  • Filter: (cth.created = $10)