explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wEFf

Settings
# exclusive inclusive rows x rows loops node
1. 0.032 4.596 ↑ 1.0 100 1

Limit (cost=2.26..6,999.19 rows=100 width=457) (actual time=0.125..4.596 rows=100 loops=1)

2. 0.172 4.564 ↑ 55.7 100 1

Nested Loop Left Join (cost=2.26..389,941.31 rows=5,573 width=457) (actual time=0.124..4.564 rows=100 loops=1)

3. 0.146 3.992 ↑ 55.7 100 1

Nested Loop Left Join (cost=1.98..388,289.92 rows=5,573 width=389) (actual time=0.110..3.992 rows=100 loops=1)

4. 0.153 3.646 ↑ 55.7 100 1

Nested Loop Left Join (cost=1.84..387,396.46 rows=5,573 width=385) (actual time=0.103..3.646 rows=100 loops=1)

5. 0.110 3.193 ↑ 55.7 100 1

Nested Loop Left Join (cost=1.57..385,774.46 rows=5,573 width=376) (actual time=0.094..3.193 rows=100 loops=1)

6. 0.185 2.383 ↑ 55.7 100 1

Nested Loop Left Join (cost=1.28..384,038.40 rows=5,573 width=333) (actual time=0.081..2.383 rows=100 loops=1)

7. 0.087 1.478 ↑ 92.9 60 1

Nested Loop Left Join (cost=0.85..130,979.76 rows=5,573 width=97) (actual time=0.055..1.478 rows=60 loops=1)

8. 1.091 1.091 ↑ 92.9 60 1

Index Scan Backward using deal_pkey on deal (cost=0.43..98,443.77 rows=5,573 width=64) (actual time=0.040..1.091 rows=60 loops=1)

  • Filter: ((office_id = 8) OR ((type = ANY ('{AGENT_OFFICE,CUSTOMER,CORRECTION}'::text[])) AND ((sender_office_id = 8) OR (receiver_office_id = 8))))
  • Rows Removed by Filter: 754
9. 0.300 0.300 ↑ 1.0 1 60

Index Scan using deal_state_pkey on deal_state (cost=0.43..5.84 rows=1 width=37) (actual time=0.005..0.005 rows=1 loops=60)

  • Index Cond: (deal_id = deal.id)
10. 0.720 0.720 ↓ 2.0 2 60

Index Scan using deal_row_deal_id_product_article_type_quantity_index on deal_row (cost=0.43..45.40 rows=1 width=240) (actual time=0.008..0.012 rows=2 loops=60)

  • Index Cond: ((deal_id = deal.id) AND (product_article_type = ANY ('{PRODUCT,CURRENCY}'::text[])))
  • Filter: ((deal.type = 'CUSTOMER'::text) OR ((quantity > '0'::numeric) AND (deal.receiver_office_id = 8)) OR ((quantity <= '0'::numeric) AND (deal.sender_office_id = 8)))
  • Rows Removed by Filter: 1
11. 0.700 0.700 ↑ 1.0 1 100

Index Scan using product_article_translations_product_article_code_language_pk on product_article_translations (cost=0.28..0.31 rows=1 width=52) (actual time=0.007..0.007 rows=1 loops=100)

  • Index Cond: ((product_article_code = deal_row.code) AND (language = 'et'::bpchar))
12. 0.300 0.300 ↓ 0.0 0 100

Index Scan using product_product_article_code_pk on product (cost=0.27..0.29 rows=1 width=19) (actual time=0.003..0.003 rows=0 loops=100)

  • Index Cond: (product_article_code = deal_row.code)
13. 0.200 0.200 ↑ 1.0 1 100

Index Scan using currency_product_article_code_pk on currency (cost=0.14..0.16 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=100)

  • Index Cond: (product_article_code = deal_row.code)
14. 0.400 0.400 ↑ 1.0 1 100

Index Only Scan using product_article_code_pk on product_article (cost=0.28..0.29 rows=1 width=9) (actual time=0.004..0.004 rows=1 loops=100)

  • Index Cond: (code = deal_row.code)
  • Heap Fetches: 99