explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B7Bo

Settings
# exclusive inclusive rows x rows loops node
1. 14.144 5,511.463 ↑ 5.8 3,702 1

Sort (cost=27,328.62..27,382.15 rows=21,412 width=512) (actual time=5,511.287..5,511.463 rows=3,702 loops=1)

  • Sort Key: "*SELECT* 1".brnid, "*SELECT* 1".stckname
  • Sort Method: quicksort Memory: 1777kB
2. 3,036.695 5,497.319 ↑ 5.8 3,702 1

Append (cost=6,942.62..20,884.95 rows=21,412 width=512) (actual time=333.919..5,497.319 rows=3,702 loops=1)

3. 0.680 2,460.624 ↑ 14.7 1,375 1

Subquery Scan on *SELECT* 1 (cost=6,942.62..14,243.78 rows=20,281 width=310) (actual time=333.918..2,460.624 rows=1,375 loops=1)

4. 2,109.614 2,459.944 ↑ 14.7 1,375 1

GroupAggregate (cost=6,942.62..14,040.97 rows=20,281 width=328) (actual time=333.917..2,459.944 rows=1,375 loops=1)

  • Group Key: brn.id, stck.id, gunt.id, si.currentsaleprice, (COALESCE(si.currentsalecurrency_id, brn.currency_id)), si.currentpurchaseprice, (COALESCE(si.currentpurchasecurrency_id, brn.currency_id)), txg.rate, txg_1.rate, br.name, acc.name
  • Filter: (sum(CASE WHEN wm.is_direction THEN COALESCE(wm.quantity, '0'::numeric) ELSE COALESCE((- wm.quantity), '0'::numeric) END) >= '0'::numeric)
  • Rows Removed by Filter: 201
5. 350.330 350.330 ↓ 3.3 66,635 1

Sort (cost=6,942.62..6,993.32 rows=20,281 width=142) (actual time=332.014..350.330 rows=66,635 loops=1)

  • Sort Key: brn.id, stck.id, gunt.id, si.currentsaleprice, (COALESCE(si.currentsalecurrency_id, brn.currency_id)), si.currentpurchaseprice, (COALESCE(si.currentpurchasecurrency_id, brn.currency_id)), txg.rate, txg_1.rate, br.name, acc.name
  • Sort Method: external merge Disk: 8856kB