explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0Y2B

Settings
# exclusive inclusive rows x rows loops node
1. 0.126 6.316 ↑ 1.0 1 1

Aggregate (cost=103.05..103.06 rows=1 width=8) (actual time=6.316..6.316 rows=1 loops=1)

2. 0.158 6.190 ↓ 18.5 517 1

Nested Loop (cost=0.84..102.98 rows=28 width=0) (actual time=0.106..6.190 rows=517 loops=1)

3. 0.862 0.862 ↓ 16.2 517 1

Index Scan using ix_company_id_user_id on contacts_importance contacts_importance_1 (cost=0.42..18.26 rows=32 width=26) (actual time=0.049..0.862 rows=517 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (user_id = '\x4c21187154397f270a000001'::bytea) AND (is_important = true))
  • Filter: (is_important IS TRUE)
4. 5.170 5.170 ↑ 1.0 1 517

Index Only Scan using contacts_pkey on contacts (cost=0.43..2.65 rows=1 width=26) (actual time=0.010..0.010 rows=1 loops=517)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (id = contacts_importance_1.contact_id))
  • Heap Fetches: 517
Planning time : 0.834 ms
Execution time : 6.409 ms