explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gmti

Settings
# exclusive inclusive rows x rows loops node
1. 2.073 5,614.498 ↓ 1.1 83 1

Index Scan using facility_name_deleted_at_index on facility (cost=0.14..25,022.53 rows=75 width=35) (actual time=60.068..5,614.498 rows=83 loops=1)

  • Index Cond: (deleted_at IS NULL)
  • Filter: (((""group"")::text <> 'Condomínio'::text) AND ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (alternatives: SubPlan 3 or hashed SubPlan 4)))
  • Rows Removed by Filter: 48
2.          

SubPlan (for Index Scan)

3. 245.614 5,587.200 ↑ 297.0 1 100

Nested Loop (cost=0.29..20,305.93 rows=297 width=0) (actual time=55.872..55.872 rows=1 loops=100)

4. 4,703.300 4,703.300 ↑ 1.0 3,191 100

Seq Scan on property_facility (cost=0.00..7,315.18 rows=3,325 width=4) (actual time=1.528..47.033 rows=3,191 loops=100)

  • Filter: ((deleted_at IS NULL) AND (facility.facility_id = facility_id))
  • Rows Removed by Filter: 327798
5. 638.286 638.286 ↓ 0.0 0 319,143

Index Scan using property_pkey on property (cost=0.29..3.91 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=319,143)

  • Index Cond: (property_id = property_facility.property_id)
  • Filter: ((deleted_at IS NULL) AND (system_id = 66))
  • Rows Removed by Filter: 1
6. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=6,564.64..13,923.45 rows=32,111 width=4) (never executed)

  • Hash Cond: (property_facility_1.property_id = property_1.property_id)
7. 0.000 0.000 ↓ 0.0 0

Seq Scan on property_facility property_facility_1 (cost=0.00..6,416.14 rows=359,087 width=8) (never executed)

  • Filter: (deleted_at IS NULL)
8. 0.000 0.000 ↓ 0.0 0

Hash (cost=6,492.72..6,492.72 rows=5,754 width=4) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on property property_1 (cost=241.01..6,492.72 rows=5,754 width=4) (never executed)

  • Recheck Cond: ((system_id = 66) AND (deleted_at IS NULL))
10. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on property_system_id_deleted_at_code_null_uindex (cost=0.00..239.57 rows=5,754 width=0) (never executed)

  • Index Cond: (system_id = 66)
11. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.29..3,414.04 rows=28 width=0) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Seq Scan on condominium (cost=0.00..1,077.19 rows=764 width=4) (never executed)

  • Filter: ((deleted_at IS NULL) AND (system_id = 66))
13. 0.000 0.000 ↓ 0.0 0

Index Only Scan using condominium_facility_condominium_id_facility_id_deleted_at_uind on condominium_facility (cost=0.29..3.06 rows=1 width=4) (never executed)

  • Index Cond: ((condominium_id = condominium.condominium_id) AND (facility_id = facility.facility_id))
  • Heap Fetches: 0
14. 8.126 25.225 ↓ 2.4 4,824 1

Hash Join (cost=926.51..1,941.39 rows=1,985 width=4) (actual time=22.406..25.225 rows=4,824 loops=1)

  • Hash Cond: (condominium_facility_1.condominium_id = condominium_1.condominium_id)
15. 15.845 15.845 ↑ 1.0 49,186 1

Seq Scan on condominium_facility condominium_facility_1 (cost=0.00..885.42 rows=49,303 width=8) (actual time=0.013..15.845 rows=49,186 loops=1)

  • Filter: (deleted_at IS NULL)
  • Rows Removed by Filter: 1045
16. 0.268 1.254 ↓ 1.5 1,115 1

Hash (cost=916.96..916.96 rows=764 width=4) (actual time=1.253..1.254 rows=1,115 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 56kB
17. 0.818 0.986 ↓ 1.5 1,115 1

Bitmap Heap Scan on condominium condominium_1 (cost=52.12..916.96 rows=764 width=4) (actual time=0.190..0.986 rows=1,115 loops=1)

  • Recheck Cond: ((system_id = 66) AND (deleted_at IS NULL))
  • Heap Blocks: exact=72
18. 0.168 0.168 ↓ 1.5 1,115 1

Bitmap Index Scan on condominium_system_id_deleted_at_index (cost=0.00..51.93 rows=764 width=0) (actual time=0.168..0.168 rows=1,115 loops=1)

  • Index Cond: ((system_id = 66) AND (deleted_at IS NULL))
Planning time : 1.613 ms
Execution time : 5,614.764 ms