explain.depesz.com

PostgreSQL's explain analyze made readable

Result: He3l

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 2,136.280 ↓ 21.0 21 1

Limit (cost=41.80..41.81 rows=1 width=22) (actual time=2,136.268..2,136.280 rows=21 loops=1)

2. 0.059 2,136.271 ↓ 21.0 21 1

Sort (cost=41.80..41.81 rows=1 width=22) (actual time=2,136.267..2,136.271 rows=21 loops=1)

  • Sort Key: (count(*)) DESC
  • Sort Method: top-N heapsort Memory: 27kB
3. 0.088 2,136.212 ↓ 61.0 61 1

GroupAggregate (cost=41.77..41.79 rows=1 width=22) (actual time=2,136.095..2,136.212 rows=61 loops=1)

  • Group Key: entity_values.value_text
4. 0.572 2,136.124 ↓ 190.0 190 1

Sort (cost=41.77..41.78 rows=1 width=14) (actual time=2,136.085..2,136.124 rows=190 loops=1)

  • Sort Key: entity_values.value_text
  • Sort Method: quicksort Memory: 36kB
5. 24.577 2,135.552 ↓ 190.0 190 1

Nested Loop (cost=33.69..41.76 rows=1 width=14) (actual time=85.856..2,135.552 rows=190 loops=1)

6. 52.994 464.321 ↓ 48,431.0 48,431 1

Nested Loop (cost=33.12..37.15 rows=1 width=305) (actual time=84.415..464.321 rows=48,431 loops=1)

7. 58.872 120.639 ↓ 48,448.0 48,448 1

HashAggregate (cost=32.55..32.56 rows=1 width=4) (actual time=84.386..120.639 rows=48,448 loops=1)

  • Group Key: entity_values_1.person_id
8. 61.767 61.767 ↓ 48,448.0 48,448 1

Index Scan using entity_values_org_id_entity_attribute_id_index on entity_values entity_values_1 (cost=0.57..32.55 rows=1 width=4) (actual time=0.031..61.767 rows=48,448 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,874
9. 290.688 290.688 ↑ 1.0 1 48,448

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

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

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.033..0.034 rows=0 loops=48,431)

  • 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 : 0.930 ms
Execution time : 2,136.869 ms