explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BFfE

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 0.050 ↓ 3.0 3 1

Nested Loop Left Join (cost=1.14..77.24 rows=1 width=92) (actual time=0.044..0.050 rows=3 loops=1)

  • Filter: (((COALESCE(rappi_credit_transactions.ends_at, rappi_credit_restrictions.ends_at) IS NULL) OR (COALESCE(rappi_credit_transactions.ends_at, rappi_credit_restrictions.ends_at) > now())) AND ((rappi_credit_restrictions.starts_at IS NULL) OR (rappi_credit_restrictions.starts_at < now())) AND ((rappi_credit_restrictions.ends_at IS NULL) OR (rappi_credit_restrictions.ends_at > now())))
  • Rows Removed by Filter: 2
2. 0.002 0.035 ↓ 1.7 5 1

Nested Loop (cost=0.84..76.19 rows=3 width=60) (actual time=0.029..0.035 rows=5 loops=1)

3. 0.021 0.021 ↑ 1.0 1 1

Index Scan using rappi_credits_application_user_id_index on rappi_credits (cost=0.42..8.44 rows=1 width=5) (actual time=0.020..0.021 rows=1 loops=1)

  • Index Cond: (application_user_id = 1912488163)
4. 0.012 0.012 ↑ 1.6 5 1

Index Scan using rappi_credit_transactions_rappi_credit_id_index on rappi_credit_transactions (cost=0.42..67.67 rows=8 width=59) (actual time=0.007..0.012 rows=5 loops=1)

  • Index Cond: (rappi_credit_id = rappi_credits.id)
  • Filter: (((state)::text = 'paid'::text) AND ((starts_at IS NULL) OR (starts_at < now())))
  • Rows Removed by Filter: 2
5. 0.005 0.005 ↓ 0.0 0 5

Index Scan using rappi_credit_restrictions_pkey on rappi_credit_restrictions (cost=0.29..0.33 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=5)

  • Index Cond: (id = rappi_credit_transactions.rappi_credit_restriction_id)
Planning time : 1.359 ms
Execution time : 0.180 ms