explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XZbi

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

HashAggregate (cost=259.17..1,516.08 rows=2 width=340) (actual rows= loops=)

  • Group Key: du.id
  • Filter: (count(tl.id) = 2)
2. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=52.82..257.21 rows=391 width=276) (actual rows= loops=)

  • Hash Cond: (du.id = tl.deviceid)
3. 0.000 0.000 ↓ 0.0

Seq Scan on devices du (cost=0.00..190.53 rows=2,653 width=272) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Hash (cost=47.94..47.94 rows=391 width=20) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=1.17..47.94 rows=391 width=20) (actual rows= loops=)

  • Hash Cond: (tl.tagid = t.id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on tag_links tl (cost=0.00..38.44 rows=2,344 width=24) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=1.15..1.15 rows=2 width=4) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Seq Scan on tags t (cost=0.00..1.15 rows=2 width=4) (actual rows= loops=)

  • Filter: ((slug)::text = ANY ('{pe,p}'::text[]))
9.          

SubPlan (for HashAggregate)

10. 0.000 0.000 ↓ 0.0

Limit (cost=626.01..626.01 rows=1 width=15) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Sort (cost=626.01..626.03 rows=9 width=15) (actual rows= loops=)

  • Sort Key: device_status."changedAt" DESC
12. 0.000 0.000 ↓ 0.0

Seq Scan on device_status (cost=0.00..625.96 rows=9 width=15) (actual rows= loops=)

  • Filter: ("deviceId" = du.id)