explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YLyD

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.242 3,259.861 ↑ 1.0 1 1

Aggregate (cost=1,005,566.82..1,005,566.83 rows=1 width=8) (actual time=3,259.861..3,259.861 rows=1 loops=1)

2. 8.391 3,258.619 ↑ 1.7 20,010 1

Sort (cost=1,005,045.12..1,005,132.07 rows=34,780 width=1,369) (actual time=3,257.707..3,258.619 rows=20,010 loops=1)

  • Sort Key: t.disconnectedat DESC, t.connectedat DESC
  • Sort Method: quicksort Memory: 1706kB
3. 4.855 3,250.228 ↑ 1.7 20,010 1

Subquery Scan on t (cost=978,661.37..981,617.67 rows=34,780 width=1,369) (actual time=3,060.653..3,250.228 rows=20,010 loops=1)

4. 67.284 3,245.373 ↑ 1.7 20,010 1

Unique (cost=978,661.37..981,269.87 rows=34,780 width=1,369) (actual time=3,060.651..3,245.373 rows=20,010 loops=1)

5. 577.260 3,178.089 ↑ 1.1 330,012 1

Sort (cost=978,661.37..979,530.87 rows=347,800 width=1,369) (actual time=3,060.650..3,178.089 rows=330,012 loops=1)

  • Sort Key: tempview.clientmac, tempview.tenantid, tempview.disconnectedat DESC, tempview.connectedat DESC
  • Sort Method: external merge Disk: 15312kB
6. 197.581 2,600.829 ↑ 1.1 330,012 1

Subquery Scan on tempview (cost=494,058.04..530,577.04 rows=347,800 width=1,369) (actual time=1,885.094..2,600.829 rows=330,012 loops=1)

7. 318.980 2,403.248 ↑ 1.1 330,012 1

Unique (cost=494,058.04..527,099.04 rows=347,800 width=1,369) (actual time=1,885.092..2,403.248 rows=330,012 loops=1)

8. 798.912 2,084.268 ↑ 1.1 330,012 1

Sort (cost=494,058.04..494,927.54 rows=347,800 width=1,369) (actual time=1,885.090..2,084.268 rows=330,012 loops=1)

  • Sort Key: activeradiussessionvm0.accountsessionid, activeradiussessionvm0.username, activeradiussessionvm0.zonewlaninfo, (concat_ws('.'::text, get_byte(activeradiussessionvm0.stationip, 0), get_byte(activeradiussessionvm0.stationip, 1), get_byte(activeradiussessionvm0.stationip, 2), get_byte(activeradiussessionvm0.stationip, 3))), (concat_ws(':'::text, encode("substring"(activeradiussessionvm0.stationipv6, 1, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 3, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 5, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 7, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 9, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 11, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 13, 2), 'hex'::text), encode("substring"(activeradiussessionvm0.stationipv6, 15, 2), 'hex'::text))), activeradiussessionvm0.stationmac, activeradiussessionvm0.epochinsertiontime, activeradiussessionvm0.sessionendtime, activeradiussessionvm0.fingerprintstamacvendor, activeradiussessionvm0.fingerprintstaosinfo, activeradiussessionvm0.fingerprintstadevicetype, activeradiussessionvm0.tenantname, activeradiussessionvm0.sessionstatus, activeradiussessionvm0.apname, activeradiussessionvm0.aptag, activeradiussessionvm0.apgrpname, activeradiussessionvm0.apmac, activeradiussessionvm0.apstate, activeradiussessionvm0.aplocation, activeradiussessionvm0.ssid, activeradiussessionvm0.nsnclientvlan, activeradiussessionvm0.zoneid, activeradiussessionvm0.zonename, activeradiussessionvm0.connectiontype, activeradiussessionvm0.authmethod, activeradiussessionvm0.wlanmac, activeradiussessionvm0.bandwidth, activeradiussessionvm0.throughput, activeradiussessionvm0.protocolname, activeradiussessionvm0.tenantid, ((date_part('epoch'::text, CURRENT_TIMESTAMP) - (activeradiussessionvm0.sessionstarttime)::double precision)), (0), (CASE WHEN (activeradiussessionvm0.smdeletedmarkedforarchive <> 0) THEN 2 WHEN (activeradiussessionvm0.sessionstatus = 8) THEN 0 WHEN (activeradiussessionvm0.sessionstatus = 2) THEN 3 ELSE 1 END), activeradiussessionvm0.client11accapability, activeradiussessionvm0.authservername, (COALESCE(activeradiussessionvm0.authenticationtime, 0)), (COALESCE(activeradiussessionvm0.dhcpduration, 0))
  • Sort Method: external merge Disk: 67704kB
9. 26.770 1,285.356 ↑ 1.1 330,012 1

Append (cost=0.00..45,973.70 rows=347,800 width=1,369) (actual time=0.019..1,285.356 rows=330,012 loops=1)

10. 1,052.183 1,258.584 ↑ 1.1 330,012 1

Result (cost=0.00..42,482.80 rows=347,760 width=1,164) (actual time=0.019..1,258.584 rows=330,012 loops=1)

11. 23.653 206.401 ↑ 1.1 330,012 1

Append (cost=0.00..13,792.60 rows=347,760 width=1,101) (actual time=0.006..206.401 rows=330,012 loops=1)

12. 96.714 96.714 ↑ 1.0 170,005 1

Seq Scan on activeradiussessionvm0 (cost=0.00..6,899.05 rows=170,005 width=1,100) (actual time=0.006..96.714 rows=170,005 loops=1)

13. 20.980 20.980 ↑ 1.0 40,002 1

Seq Scan on activeradiussessionvm1 (cost=0.00..1,543.02 rows=40,002 width=1,102) (actual time=0.007..20.980 rows=40,002 loops=1)

14. 21.156 21.156 ↑ 1.0 40,002 1

Seq Scan on activeradiussessionvm2 (cost=0.00..1,543.02 rows=40,002 width=1,102) (actual time=0.008..21.156 rows=40,002 loops=1)

15. 21.555 21.555 ↑ 1.0 40,002 1

Seq Scan on activeradiussessionvm3 (cost=0.00..1,543.02 rows=40,002 width=1,102) (actual time=0.008..21.555 rows=40,002 loops=1)

16. 11.876 11.876 ↑ 1.9 20,001 1

Seq Scan on activeradiussessionvm4 (cost=0.00..1,450.89 rows=37,589 width=1,102) (actual time=0.010..11.876 rows=20,001 loops=1)

17. 10.448 10.448 ↑ 1.0 20,000 1

Seq Scan on activeradiussessionvm5 (cost=0.00..772.00 rows=20,000 width=1,102) (actual time=0.008..10.448 rows=20,000 loops=1)

18. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on activeradiussessionvm6 (cost=0.00..10.40 rows=40 width=1,359) (actual time=0.004..0.004 rows=0 loops=1)

19. 0.006 0.006 ↓ 0.0 0 1

Seq Scan on activeradiussessionvm7 (cost=0.00..10.40 rows=40 width=1,359) (actual time=0.006..0.006 rows=0 loops=1)

20. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on activeradiussessionvm8 (cost=0.00..10.40 rows=40 width=1,359) (actual time=0.007..0.007 rows=0 loops=1)

21. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on activeradiussessionvm9 (cost=0.00..10.40 rows=40 width=1,359) (actual time=0.002..0.002 rows=0 loops=1)

22. 0.000 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.00..13.30 rows=40 width=1,369) (actual time=0.002..0.002 rows=0 loops=1)

23. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on archiveradiussession arch (cost=0.00..12.80 rows=40 width=1,365) (actual time=0.002..0.002 rows=0 loops=1)