explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1YxY

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

Sort (cost=36,547.11..36,548.99 rows=751 width=88) (actual rows= loops=)

  • Sort Key: (count(DISTINCT pii.id)) DESC
2. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=36,494.34..36,511.24 rows=751 width=88) (actual rows= loops=)

  • Group Key: p.id, v.id
  • Filter: (count(DISTINCT pii.id) > 15)
3. 0.000 0.000 ↓ 0.0

Sort (cost=36,494.34..36,496.22 rows=751 width=84) (actual rows= loops=)

  • Sort Key: p.id, v.id
4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16,815.05..36,458.47 rows=751 width=84) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16,814.77..35,113.10 rows=3,454 width=56) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=16,814.35..32,267.71 rows=4,515 width=8) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Join (cost=16,813.92..26,053.64 rows=3,556 width=4) (actual rows= loops=)

  • Hash Cond: (pi.user_id = u.id)
8. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on payment_invoices pi (cost=2,699.16..11,574.90 rows=87,579 width=8) (actual rows= loops=)

  • Recheck Cond: ((status = 2999) AND (deleted_at IS NULL))
9. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on payment_invoice_status_id_index (cost=0.00..2,677.26 rows=87,579 width=0) (actual rows= loops=)

  • Index Cond: (status = 2999)
10. 0.000 0.000 ↓ 0.0

Hash (cost=13,987.23..13,987.23 rows=10,203 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Seq Scan on users u (cost=0.00..13,987.23 rows=10,203 width=4) (actual rows= loops=)

  • Filter: (city = 2531)
12. 0.000 0.000 ↓ 0.0

Index Scan using index_invoice_id on payment_invoice_items pii (cost=0.42..1.68 rows=7 width=12) (actual rows= loops=)

  • Index Cond: (invoice_id = pi.id)
  • Filter: (deleted_at IS NULL)
13. 0.000 0.000 ↓ 0.0

Index Scan using products_pkey on products p (cost=0.42..0.62 rows=1 width=52) (actual rows= loops=)

  • Index Cond: (id = pii.product_id)
  • Filter: (published AND (deleted_at IS NULL))
14. 0.000 0.000 ↓ 0.0

Index Scan using vendors_pkey on vendors v (cost=0.29..0.38 rows=1 width=32) (actual rows= loops=)

  • Index Cond: (id = p.sn_page_id)
  • Filter: (status = 2987)