explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8nlX

Settings
# exclusive inclusive rows x rows loops node
1. 4.319 907.017 ↓ 3.8 1,493 1

Nested Loop Left Join (cost=17.39..132,216.47 rows=390 width=199) (actual time=192.382..907.017 rows=1,493 loops=1)

2. 1.328 123.352 ↓ 3.8 1,493 1

Nested Loop (cost=16.97..129,902.28 rows=390 width=190) (actual time=0.323..123.352 rows=1,493 loops=1)

3. 0.111 115.238 ↓ 2.8 234 1

Nested Loop (cost=0.56..43,737.75 rows=84 width=85) (actual time=0.268..115.238 rows=234 loops=1)

4. 0.130 0.130 ↑ 1.0 1 1

Seq Scan on users u (cost=0.00..17.65 rows=1 width=18) (actual time=0.125..0.130 rows=1 loops=1)

  • Filter: ((username)::text = '111'::text)
  • Rows Removed by Filter: 371
5. 114.997 114.997 ↓ 2.0 234 1

Index Scan using idx_tx_2 on pos_transaction t (cost=0.56..43,718.93 rows=117 width=81) (actual time=0.137..114.997 rows=234 loops=1)

  • Index Cond: (((type)::text = 'SALE'::text) AND ((status)::text = 'COMPLETED'::text) AND ((user_id)::text = (u.user_id)::text))
  • Filter: (date_trunc('day'::text, transaction_date) = '2019-07-01 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 58901
6. 1.638 6.786 ↑ 57.7 6 234

Bitmap Heap Scan on pos_tx_item tx (cost=16.41..1,022.31 rows=346 width=123) (actual time=0.026..0.029 rows=6 loops=234)

  • Recheck Cond: ((pos_txn_id)::text = (t.id)::text)
  • Heap Blocks: exact=297
7. 5.148 5.148 ↑ 57.7 6 234

Bitmap Index Scan on idx_tx_itm (cost=0.00..16.33 rows=346 width=0) (actual time=0.022..0.022 rows=6 loops=234)

  • Index Cond: ((pos_txn_id)::text = (t.id)::text)
8. 779.346 779.346 ↑ 1.0 1 1,493

Index Scan using product_pkey on product p (cost=0.42..5.87 rows=1 width=45) (actual time=0.514..0.522 rows=1 loops=1,493)

  • Index Cond: ((tx.product_id)::text = (plu_id)::text)
Planning time : 2.661 ms
Execution time : 907.384 ms