explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Caqo

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 805.834 ↓ 21.0 21 1

Limit (cost=62.19..62.20 rows=1 width=22) (actual time=805.832..805.834 rows=21 loops=1)

2. 0.017 805.832 ↓ 21.0 21 1

Sort (cost=62.19..62.20 rows=1 width=22) (actual time=805.831..805.832 rows=21 loops=1)

  • Sort Key: (count(*)) DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.038 805.815 ↓ 61.0 61 1

GroupAggregate (cost=62.16..62.18 rows=1 width=22) (actual time=805.775..805.815 rows=61 loops=1)

  • Group Key: entity_values.value_text
4. 0.290 805.777 ↓ 192.0 192 1

Sort (cost=62.16..62.17 rows=1 width=14) (actual time=805.768..805.777 rows=192 loops=1)

  • Sort Key: entity_values.value_text
  • Sort Method: quicksort Memory: 37kB
5. 0.000 805.487 ↓ 192.0 192 1

Nested Loop (cost=54.08..62.15 rows=1 width=14) (actual time=92.589..805.487 rows=192 loops=1)

6. 27.328 277.251 ↓ 48,432.0 48,432 1

Nested Loop (cost=53.51..57.54 rows=1 width=305) (actual time=92.489..277.251 rows=48,432 loops=1)

7. 24.151 104.576 ↓ 48,449.0 48,449 1

HashAggregate (cost=52.94..52.95 rows=1 width=4) (actual time=92.471..104.576 rows=48,449 loops=1)

  • Group Key: entity_values_1.person_id
8. 80.425 80.425 ↓ 48,449.0 48,449 1

Index Scan using entity_values_org_id_entity_attribute_id_index on entity_values entity_values_1 (cost=0.57..52.94 rows=1 width=4) (actual time=0.406..80.425 rows=48,449 loops=1)

  • Index Cond: ((org_id = 2,310) AND (entity_attribute_id = 72,323))
  • Filter: ((value_location).country = 'United States'::text)
  • Rows Removed by Filter: 14,875
9. 145.347 145.347 ↑ 1.0 1 48,449

Index Scan using persons_id_index on persons (cost=0.56..4.59 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=48,449)

  • Index Cond: (id = entity_values_1.person_id)
  • Filter: ((org_id = 2,310) AND (type = 0))
  • Rows Removed by Filter: 0
10. 532.752 532.752 ↓ 0.0 0 48,432

Index Scan using entity_values_org_id_person_id_index on entity_values (cost=0.57..4.59 rows=1 width=18) (actual time=0.011..0.011 rows=0 loops=48,432)

  • Index Cond: ((org_id = 2,310) AND (person_id = persons.id))
  • Filter: ((value_text ~* '\mAngel'::text) AND (entity_attribute_id = 72,320))
  • Rows Removed by Filter: 8
Planning time : 1.514 ms
Execution time : 805.889 ms