explain.depesz.com

PostgreSQL's explain analyze made readable

Result: p9Mp

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 0.813 ↑ 1.0 10 1

Limit (cost=1.42..14.54 rows=10 width=295) (actual time=0.266..0.813 rows=10 loops=1)

2. 0.152 0.805 ↑ 23,052.8 10 1

Nested Loop Left Join (cost=1.42..302,537.60 rows=230,528 width=295) (actual time=0.263..0.805 rows=10 loops=1)

3. 0.076 0.603 ↑ 23,052.8 10 1

Nested Loop Left Join (cost=1.27..261,606.88 rows=230,528 width=248) (actual time=0.199..0.603 rows=10 loops=1)

  • Join Filter: (((api.id)::character varying)::text = (tr.user2_id)::text)
  • Rows Removed by Join Filter: 36
4. 0.036 0.497 ↑ 23,052.8 10 1

Nested Loop Left Join (cost=1.27..243,163.59 rows=230,528 width=224) (actual time=0.141..0.497 rows=10 loops=1)

5. 0.041 0.391 ↑ 23,052.8 10 1

Nested Loop Left Join (cost=0.99..172,532.55 rows=230,528 width=197) (actual time=0.124..0.391 rows=10 loops=1)

6. 0.062 0.230 ↑ 23,052.8 10 1

Nested Loop (cost=0.71..92,220.23 rows=230,528 width=160) (actual time=0.080..0.230 rows=10 loops=1)

7. 0.058 0.058 ↑ 23,052.8 10 1

Index Scan Backward using transactions_created_at_idx on transactions tr (cost=0.42..11,907.91 rows=230,528 width=131) (actual time=0.043..0.058 rows=10 loops=1)

8. 0.110 0.110 ↑ 1.0 1 10

Index Scan using users_pkey on users u1 (cost=0.29..0.34 rows=1 width=37) (actual time=0.011..0.011 rows=1 loops=10)

  • Index Cond: (id = tr.user_id)
9. 0.120 0.120 ↓ 0.0 0 10

Index Scan using users_id_idx on users u2 (cost=0.29..0.34 rows=1 width=37) (actual time=0.012..0.012 rows=0 loops=10)

  • Index Cond: (((id)::character varying)::text = (tr.user2_id)::text)
10. 0.070 0.070 ↓ 0.0 0 10

Index Scan using invoices_id_idx on invoices inv (cost=0.28..0.30 rows=1 width=35) (actual time=0.007..0.007 rows=0 loops=10)

  • Index Cond: (((id)::character varying)::text = (tr.order_id)::text)
11. 0.021 0.030 ↑ 1.0 4 10

Materialize (cost=0.00..1.06 rows=4 width=28) (actual time=0.002..0.003 rows=4 loops=10)

12. 0.009 0.009 ↑ 1.0 4 1

Seq Scan on api_users api (cost=0.00..1.04 rows=4 width=28) (actual time=0.008..0.009 rows=4 loops=1)

13. 0.050 0.050 ↓ 0.0 0 10

Index Scan using services_id_idx on services svc (cost=0.14..0.16 rows=1 width=51) (actual time=0.005..0.005 rows=0 loops=10)

  • Index Cond: (((id)::character varying)::text = (tr.user2_id)::text)