explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RCrA

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=6,744.21..6,744.22 rows=1 width=130) (actual rows= loops=)

  • Sort Key: (CASE WHEN ((conditions_documents.countries @> '["us"]'::jsonb) AND conditions_documents.official) THEN 4 WHEN (conditions_documents.is_default AND conditions_documents.official) THEN 3 WHEN conditions_documents.is_default THEN 2 ELSE 0 END) DESC
2. 0.000 0.000 ↓ 0.0

Seq Scan on conditions_documents (cost=0.00..6,744.20 rows=1 width=130) (actual rows= loops=)

  • Filter: ((((countries @> '["us"]'::jsonb) AND official) OR is_default) AND ((SubPlan 1) = 0))
3.          

SubPlan (forSeq Scan)

4. 0.000 0.000 ↓ 0.0

Aggregate (cost=12.68..12.69 rows=1 width=8) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on user_condition_acceptances (cost=4.19..12.68 rows=2 width=0) (actual rows= loops=)

  • Recheck Cond: (conditions_document_id = conditions_documents.id)
  • Filter: (accepted_at < conditions_documents.created_at)
6. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on index_user_condition_acceptances_on_conditions_document_id (cost=0.00..4.19 rows=5 width=0) (actual rows= loops=)

  • Index Cond: (conditions_document_id = conditions_documents.id)