explain.depesz.com

PostgreSQL's explain analyze made readable

Result: abJD

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

Nested Loop (cost=58.65..173.97 rows=28 width=473) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

HashAggregate (cost=50.29..50.32 rows=3 width=45) (actual rows= loops=)

  • Group Key: "user".ref_id, inventory.id, permissions.create_application, permissions.read_application, permissions.update_application, permissions.create_inventory, permissions.read_inventory, permissions.update_inventory, permissions.create_user, permissions.read_user, permissions.update_user, permissions.control_device, permissions.create_device, permissions.read_device, permissions.update_device
3. 0.000 0.000 ↓ 0.0

Append (cost=0.86..50.17 rows=3 width=45) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..25.12 rows=1 width=45) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.86..25.09 rows=1 width=37) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..16.78 rows=1 width=37) (actual rows= loops=)

  • Join Filter: ("user".parent_id = user_group.id)
7. 0.000 0.000 ↓ 0.0

Index Scan using asset_type_idx on asset "user" (cost=0.29..8.36 rows=2 width=32) (actual rows= loops=)

  • Index Cond: (type = 'user'::e_asset_type)
  • Filter: (deleted_at IS NULL)
8. 0.000 0.000 ↓ 0.0

Materialize (cost=0.29..8.37 rows=2 width=37) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Index Scan using asset_type_idx on asset user_group (cost=0.29..8.36 rows=2 width=37) (actual rows= loops=)

  • Index Cond: (type = 'user_group'::e_asset_type)
  • Filter: (deleted_at IS NULL)
10. 0.000 0.000 ↓ 0.0

Index Scan using asset_pkey on asset inventory (cost=0.29..8.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = user_group.parent_id)
  • Filter: ((deleted_at IS NULL) AND (type = 'inventory'::e_asset_type))
11. 0.000 0.000 ↓ 0.0

Function Scan on jsonb_populate_record permissions (cost=0.00..0.01 rows=1 width=13) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..25.03 rows=2 width=45) (actual rows= loops=)

13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..24.99 rows=2 width=37) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan using asset_type_idx on asset user_1 (cost=0.29..8.36 rows=2 width=37) (actual rows= loops=)

  • Index Cond: (type = 'user'::e_asset_type)
  • Filter: (deleted_at IS NULL)
15. 0.000 0.000 ↓ 0.0

Index Scan using asset_pkey on asset inventory_1 (cost=0.29..8.30 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (id = user_1.parent_id)
  • Filter: ((deleted_at IS NULL) AND (type = 'inventory'::e_asset_type))
16. 0.000 0.000 ↓ 0.0

Function Scan on jsonb_populate_record permissions_1 (cost=0.00..0.01 rows=1 width=13) (actual rows= loops=)

17. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on asset (cost=8.36..41.12 rows=9 width=428) (actual rows= loops=)

  • Recheck Cond: (path ~ (concat('*.', replace((inventory.id)::text, '-'::text, ''::text), '.*'))::lquery)
  • Filter: ((type = 'inventory'::e_asset_type) OR (type = 'device'::e_asset_type) OR (type = 'device_group'::e_asset_type))
18. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on asset_path_gist (cost=0.00..8.36 rows=9 width=0) (actual rows= loops=)

  • Index Cond: (path ~ (concat('*.', replace((inventory.id)::text, '-'::text, ''::text), '.*'))::lquery)