explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LuDg

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.087 ↓ 0.0 0 1

Limit (cost=24.18..24.19 rows=1 width=17) (actual time=0.087..0.087 rows=0 loops=1)

2. 0.008 0.086 ↓ 0.0 0 1

Sort (cost=24.18..24.19 rows=1 width=17) (actual time=0.086..0.086 rows=0 loops=1)

  • Sort Key: (max(ts_rank(to_tsvector('suggestions'::regconfig, translate(regexp_replace((contacts_values_1.value__json ->> 'city'::text), '(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'::text, ' '::text, 'g'::text), '\\@.:/+<>^&''()*!|'::text, '------'::text)), '''marino4ka1964'' <-> ''64'' <-> ''mail'' <-> ''ru'''::tsquery, 1))) DESC
  • Sort Method: quicksort Memory: 25kB
3. 0.000 0.078 ↓ 0.0 0 1

Nested Loop Left Join (cost=21.55..24.17 rows=1 width=17) (actual time=0.078..0.078 rows=0 loops=1)

  • Join Filter: ((contacts_values_1.company_id = contacts.company_id) AND (contacts_values_1.id = contacts.id))
4. 0.001 0.078 ↓ 0.0 0 1

Nested Loop (cost=10.99..13.30 rows=1 width=26) (actual time=0.078..0.078 rows=0 loops=1)

5. 0.001 0.077 ↓ 0.0 0 1

HashAggregate (cost=10.56..10.57 rows=1 width=32) (actual time=0.077..0.077 rows=0 loops=1)

  • Group Key: contacts_values.id
6. 0.037 0.076 ↓ 0.0 0 1

Bitmap Heap Scan on contacts_values (cost=5.02..10.56 rows=1 width=32) (actual time=0.076..0.076 rows=0 loops=1)

  • Recheck Cond: (((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_work'::text)) OR ((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_home'::text)) OR ((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_other'::text)))
  • Filter: (((value__json ->> 'city'::text) IS NOT NULL) AND (to_tsvector('suggestions'::regconfig, translate(regexp_replace((value__json ->> 'city'::text), '(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'::text, ' '::text, 'g'::text), '\\@.:/+<>^&''()*!|'::text, '------'::text)) @@ '''marino4ka1964'' <-> ''64'' <-> ''mail'' <-> ''ru'''::tsquery))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
7. 0.001 0.039 ↓ 0.0 0 1

BitmapOr (cost=5.02..5.02 rows=4 width=0) (actual time=0.039..0.039 rows=0 loops=1)

8. 0.025 0.025 ↑ 1.0 1 1

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (actual time=0.025..0.025 rows=1 loops=1)

  • Index Cond: ((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_work'::text))
9. 0.007 0.007 ↓ 0.0 0 1

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_home'::text))
10. 0.006 0.006 ↓ 0.0 0 1

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((company_id = '\x587bf8c2844cdf6dc3ffa645'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_other'::text))
11. 0.000 0.000 ↓ 0.0 0

Index Only Scan using contacts_pkey on contacts (cost=0.43..2.65 rows=1 width=26) (never executed)

  • Index Cond: ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (id = contacts_values.id))
  • Heap Fetches: 0
12. 0.000 0.000 ↓ 0.0 0

GroupAggregate (cost=10.57..10.85 rows=1 width=68) (never executed)

  • Group Key: contacts_values_1.company_id, contacts_values_1.id
13. 0.000 0.000 ↓ 0.0 0

Sort (cost=10.57..10.57 rows=1 width=96) (never executed)

  • Sort Key: contacts_values_1.id
14. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on contacts_values contacts_values_1 (cost=5.02..10.56 rows=1 width=96) (never executed)

  • Recheck Cond: (((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_work'::text)) OR ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_home'::text)) OR ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_other'::text)))
  • Filter: (((value__json ->> 'city'::text) IS NOT NULL) AND (to_tsvector('suggestions'::regconfig, translate(regexp_replace((value__json ->> 'city'::text), '(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])'::text, ' '::text, 'g'::text), '\\@.:/+<>^&''()*!|'::text, '------'::text)) @@ '''marino4ka1964'' <-> ''64'' <-> ''mail'' <-> ''ru'''::tsquery))
15. 0.000 0.000 ↓ 0.0 0

BitmapOr (cost=5.02..5.02 rows=4 width=0) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (never executed)

  • Index Cond: ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_work'::text))
17. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (never executed)

  • Index Cond: ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_home'::text))
18. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ix_company_id_field_value_norm (cost=0.00..1.67 rows=1 width=0) (never executed)

  • Index Cond: ((company_id = '\x5c78353837626638633238343463646636646333666661363435'::bytea) AND (field_id = '\x000000000000000000000000'::bytea) AND (field_name = 'address_other'::text))
Planning time : 1.214 ms
Execution time : 0.320 ms