explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B9HO

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 5,054.312 ↑ 1.0 20 1

Limit (cost=102,236.39..102,236.44 rows=20 width=22) (actual time=5,054.293..5,054.312 rows=20 loops=1)

2. 18.360 5,054.297 ↑ 231.6 20 1

Sort (cost=102,236.39..102,247.97 rows=4,632 width=22) (actual time=5,054.292..5,054.297 rows=20 loops=1)

  • Sort Key: (count(*)) DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 109.690 5,035.937 ↓ 12.5 57,838 1

GroupAggregate (cost=102,026.24..102,113.14 rows=4,632 width=22) (actual time=4,842.642..5,035.937 rows=57,838 loops=1)

  • Group Key: entity_values.value_text
4. 910.025 4,926.247 ↓ 54.7 295,982 1

Sort (cost=102,026.24..102,039.77 rows=5,410 width=14) (actual time=4,841.499..4,926.247 rows=295,982 loops=1)

  • Sort Key: entity_values.value_text
  • Sort Method: quicksort Memory: 30469kB
5. 201.624 4,016.222 ↓ 54.7 295,982 1

Hash Join (cost=73,025.64..101,690.79 rows=5,410 width=14) (actual time=1,525.886..4,016.222 rows=295,982 loops=1)

  • Hash Cond: (entity_values.company_id = rows.company_id)
6. 2,294.292 2,294.292 ↓ 27.3 295,981 1

Index Scan using entity_values_org_id_entity_attribute_id_company_id_index on entity_values (cost=0.57..24,507.48 rows=10,836 width=18) (actual time=0.876..2,294.292 rows=295,981 loops=1)

  • Index Cond: ((organization_id = 2197) AND (entity_attribute_id = 68521))
  • Filter: (value_text IS NOT NULL)
7. 435.285 1,520.306 ↓ 2.0 1,076,956 1

Hash (cost=66,429.73..66,429.73 rows=527,627 width=4) (actual time=1,520.306..1,520.306 rows=1,076,956 loops=1)

  • Buckets: 2097152 (originally 1048576) Batches: 1 (originally 1) Memory Usage: 54246kB
8. 452.611 1,085.021 ↓ 2.0 1,076,956 1

Subquery Scan on rows (cost=42.83..66,429.73 rows=527,627 width=4) (actual time=0.029..1,085.021 rows=1,076,956 loops=1)

9. 632.400 632.410 ↓ 2.0 1,076,956 1

Index Scan using lists_entries_list_id_index on lists_entries (cost=42.83..61,153.46 rows=527,627 width=44) (actual time=0.028..632.410 rows=1,076,956 loops=1)

  • Index Cond: (list_id = 24065)
  • Filter: ((NOT (hashed SubPlan 1)) AND (organization_id = 2197))
10.          

SubPlan (forIndex Scan)

11. 0.004 0.010 ↓ 0.0 0 1

Bitmap Heap Scan on demo_data (cost=2.50..42.39 rows=1 width=4) (actual time=0.009..0.010 rows=0 loops=1)

  • Recheck Cond: (organization_id = 2197)
  • Filter: (demo_company_id IS NOT NULL)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
12. 0.006 0.006 ↑ 29.0 1 1

Bitmap Index Scan on demo_data_pkey (cost=0.00..2.50 rows=29 width=0) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (organization_id = 2197)