explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ndq2

Settings
# exclusive inclusive rows x rows loops node
1. 0.036 0.854 ↓ 44.0 44 1

Sort (cost=735.12..735.13 rows=1 width=328) (actual time=0.852..0.854 rows=44 loops=1)

  • Sort Key: rs.rs_time
  • Sort Method: quicksort Memory: 36kB
2. 0.028 0.818 ↓ 44.0 44 1

Nested Loop Left Join (cost=1.28..735.11 rows=1 width=328) (actual time=0.149..0.818 rows=44 loops=1)

3. 0.034 0.570 ↓ 44.0 44 1

Nested Loop (cost=1.28..727.71 rows=1 width=212) (actual time=0.116..0.570 rows=44 loops=1)

4. 0.032 0.492 ↓ 44.0 44 1

Nested Loop (cost=1.00..725.12 rows=1 width=196) (actual time=0.108..0.492 rows=44 loops=1)

5. 0.040 0.416 ↓ 44.0 44 1

Nested Loop (cost=0.71..723.68 rows=1 width=192) (actual time=0.100..0.416 rows=44 loops=1)

6. 0.011 0.332 ↓ 44.0 44 1

Nested Loop (cost=0.42..721.08 rows=1 width=177) (actual time=0.092..0.332 rows=44 loops=1)

7. 0.165 0.189 ↓ 11.0 44 1

Append (cost=0.00..710.12 rows=4 width=169) (actual time=0.080..0.189 rows=44 loops=1)

  • -> Index Scan using receiptsale_9_2016_fk_receipt_idx on receiptsale_9_2016 rs_2 (cost=0.56..379.81 rows=1 width=116) (actual time=0.040..0.040 ro
  • -> Index Scan using receiptsale_9_2017_fk_receipt_idx on receiptsale_9_2017 rs_3 (cost=0.56..328.55 rows=1 width=115) (actual time=0.015..0.119 ro
8. 0.012 0.012 ↓ 0.0 0 1

Seq Scan on receiptsale rs (cost=0.00..0.00 rows=1 width=328) (actual time=0.012..0.012 rows=0 loops=1)

  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01
9. 0.012 0.012 ↓ 0.0 0 1

Seq Scan on receiptsale_9 rs_1 (cost=0.00..1.56 rows=1 width=117) (actual time=0.012..0.012 rows=0 loops=1)

  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01
  • Rows Removed by Filter: 4
  • Index Cond: (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3179410191,3179411952
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01
  • Index Cond: (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3179410191,3179411952
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01
  • Rows Removed by Filter: 4
10. 0.132 0.132 ↑ 1.0 1 44

Index Scan using salearticle_pkey on salearticle sa (cost=0.42..2.74 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=44)

  • Index Cond: (id = rs.fk_salearticle)
  • Filter: (fk_client = 1634005599)
11. 0.044 0.044 ↑ 1.0 1 44

Index Scan using articlegroup_pkey on articlegroup ag (cost=0.29..2.60 rows=1 width=31) (actual time=0.001..0.001 rows=1 loops=44)

  • Index Cond: (id = rs.fk_articlegroup)
12. 0.044 0.044 ↑ 1.0 1 44

Index Scan using maingroup_pkey on maingroup mg (cost=0.29..1.44 rows=1 width=20) (actual time=0.001..0.001 rows=1 loops=44)

  • Index Cond: (id = ag.fk_maingroup)
13. 0.044 0.044 ↑ 1.0 1 44

Index Scan using operationalunit_pkey on operationalunit ou (cost=0.28..2.59 rows=1 width=24) (actual time=0.001..0.001 rows=1 loops=44)

  • Index Cond: (id = rs.fk_operationalunit)
14. 0.220 0.220 ↓ 0.0 0 44

Append (cost=0.00..7.00 rows=4 width=124) (actual time=0.005..0.005 rows=0 loops=44)

  • -> Index Scan using receiptaction_9_2016_fk_receipt_idx on receiptaction_9_2016 rowcommentra_2 (cost=0.43..3.42 rows=1 width=188) (actual time=0.001..0.001 rows=0 loops=4
  • -> Index Scan using receiptaction_9_2017_fk_receipt_idx on receiptaction_9_2017 rowcommentra_3 (cost=0.43..3.38 rows=1 width=212) (actual time=0.002..0.002 rows=0 loops=4
15. 0.000 0.000 ↓ 0.0 0 44

Seq Scan on receiptaction rowcommentra (cost=0.00..0.00 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=44)

  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
16. 0.000 0.000 ↓ 0.0 0 44

Seq Scan on receiptaction_9 rowcommentra_1 (cost=0.00..0.00 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=44)

  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Index Cond: (fk_receipt = rs.fk_receipt)
  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Index Cond: (fk_receipt = rs.fk_receipt)
  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Rows Removed by Filter: 0
Planning time : 29.892 ms
Execution time : 1.001 ms