explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2grE

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 1,051.033 ↑ 88.5 2 1

GroupAggregate (cost=64,001.90..64,005.00 rows=177 width=12) (actual time=1,051.032..1,051.033 rows=2 loops=1)

  • Group Key: entity_values.value_company_id
2. 0.008 1,051.027 ↑ 88.5 2 1

Sort (cost=64,001.90..64,002.35 rows=177 width=4) (actual time=1,051.026..1,051.027 rows=2 loops=1)

  • Sort Key: entity_values.value_company_id
  • Sort Method: quicksort Memory: 25kB
3. 0.085 1,051.019 ↑ 88.5 2 1

Hash Join (cost=63,193.06..63,995.30 rows=177 width=4) (actual time=1,051.012..1,051.019 rows=2 loops=1)

  • Hash Cond: (entity_values.company_id = rows.id)
4. 0.011 0.023 ↑ 213.0 2 1

Bitmap Heap Scan on entity_values (cost=7.73..806.60 rows=426 width=8) (actual time=0.018..0.023 rows=2 loops=1)

  • Recheck Cond: (entity_attribute_id = 120416)
  • Heap Blocks: exact=2
5. 0.012 0.012 ↑ 213.0 2 1

Bitmap Index Scan on entity_values_entity_attribute_id_company_id_index (cost=0.00..7.62 rows=426 width=0) (actual time=0.012..0.012 rows=2 loops=1)

  • Index Cond: (entity_attribute_id = 120416)
6. 30.568 1,050.911 ↓ 1.9 89,515 1

Hash (cost=62,605.66..62,605.66 rows=46,373 width=4) (actual time=1,050.911..1,050.911 rows=89,515 loops=1)

  • Buckets: 131072 (originally 65536) Batches: 1 (originally 1) Memory Usage: 4172kB
7. 36.739 1,020.343 ↓ 1.9 89,515 1

Subquery Scan on rows (cost=70.87..62,605.66 rows=46,373 width=4) (actual time=0.865..1,020.343 rows=89,515 loops=1)

8. 388.067 983.604 ↓ 1.9 89,515 1

Merge Semi Join (cost=70.87..62,141.93 rows=46,373 width=249) (actual time=0.865..983.604 rows=89,515 loops=1)

  • Merge Cond: (companies.id = organizations_relevant_companies.company_id)
9. 563.206 563.679 ↓ 2.0 1,525,113 1

Index Only Scan using companies_pkey on companies (cost=52.48..44,904.56 rows=763,145 width=4) (actual time=0.844..563.679 rows=1,525,113 loops=1)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1031
  • Heap Fetches: 1
10.          

SubPlan (forIndex Only Scan)

11. 0.473 0.473 ↑ 1.0 1,032 1

Seq Scan on hidden_globals (cost=0.00..49.48 rows=1,032 width=4) (actual time=0.008..0.473 rows=1,032 loops=1)

  • Filter: (organization_id = 7)
  • Rows Removed by Filter: 1566
12. 31.858 31.858 ↑ 1.0 89,595 1

Index Only Scan using organizations_relevant_companies_organization_id_company_id_idx on organizations_relevant_companies (cost=0.43..14,635.36 rows=92,746 width=4) (actual time=0.016..31.858 rows=89,595 loops=1)

  • Index Cond: (organization_id = 7)
  • Heap Fetches: 89595