Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUERY PLAN
- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Limit (cost=197080.67..2050351.38 rows=10 width=56) (actual time=250382.564..250382.569 rows=1 loops=1)
- -> GroupAggregate (cost=197080.67..3347640.88 rows=17 width=56) (actual time=250382.563..250382.566 rows=1 loops=1)
- Group Key: materialized_billable_xact_summary.usr, (sum(materialized_billable_xact_summary.balance_owed))
- -> Incremental Sort (cost=197080.67..3347640.54 rows=17 width=56) (actual time=250382.510..250382.524 rows=205 loops=1)
- Sort Key: materialized_billable_xact_summary.usr, (sum(materialized_billable_xact_summary.balance_owed))
- Presorted Key: materialized_billable_xact_summary.usr
- Full-sort Groups: 1 Sort Method: quicksort Average Memory: 27kB Peak Memory: 27kB
- Pre-sorted Groups: 1 Sort Method: quicksort Average Memory: 32kB Peak Memory: 32kB
- -> Nested Loop (cost=170.71..3347639.78 rows=17 width=56) (actual time=54272.879..250382.418 rows=205 loops=1)
- Join Filter: (au.id = mbts.usr)
- -> Merge Join (cost=170.15..3347606.54 rows=1 width=44) (actual time=54272.844..250382.251 rows=1 loops=1)
- Merge Cond: (materialized_billable_xact_summary.usr = au.id)
- -> GroupAggregate (cost=0.57..3346375.76 rows=84859 width=100) (actual time=49.342..250377.910 rows=1530 loops=1)
- Group Key: materialized_billable_xact_summary.usr
- Filter: (sum(materialized_billable_xact_summary.balance_owed) < '0'::numeric)
- Rows Removed by Filter: 1325752
- -> Index Scan using money_mat_summary_usr_idx on materialized_billable_xact_summary (cost=0.57..3314556.65 rows=5600094 width=7) (actual time=0.014..247987.317 rows=5569673 loops=1)
- Filter: (xact_finish IS NULL)
- Rows Removed by Filter: 85698224
- -> Sort (cost=169.58..169.81 rows=91 width=8) (actual time=0.522..0.645 rows=96 loops=1)
- Sort Key: au.id
- Sort Method: quicksort Memory: 27kB
- -> Index Scan using actor_usr_home_ou_idx on usr au (cost=0.43..166.62 rows=91 width=8) (actual time=0.051..0.488 rows=98 loops=1)
- Index Cond: (home_ou = 394)
- Filter: (NOT deleted)
- -> Index Scan using money_mat_summary_usr_idx on materialized_billable_xact_summary mbts (cost=0.57..28.75 rows=359 width=20) (actual time=0.027..0.121 rows=205 loops=1)
- Index Cond: (usr = materialized_billable_xact_summary.usr)
- Planning Time: 0.751 ms
- Execution Time: 250382.625 ms
- (29 rows)
Advertisement
Add Comment
Please, Sign In to add comment