add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
version
PostgreSQL 12.6 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit
5 rows affected
manager_id manager_name
1 N'Ketchi Obaya
2 Sean C4itizen
3 Joe Sixpack
4 Joan Doe
5 Oisín O'Shea
setval
999
4 rows affected
deal_id deal_name
1000 Bitcoin 1
1001 Bitcoin 2
1002 Ethereum 1
1003 Ethereum 2
m_dt man_id d_id m_type m_dt ins_amount p_tot_prev p_tot ?column?
null 1 1000 D 2021-05-06 13:51:56 111111111 0 0 111111111
1 rows affected
p_id mid d_id typ m_dt amount t_prev d_tot t_t
1 1 1000 D 2021-05-06 13:51:56 33 0 33 33
man_id d_id m_type m_dt ins_amount p_tot_prev p_tot ?column?
1 1000 D 2021-05-06 13:51:55.740736+01 1111111 0 33 1111144
1 rows affected
p_id mid d_id typ m_dt amount t_prev d_tot t_t
1 1 1000 D 2021-05-06 13:51:56 33 0 33 33
2 1 1000 C 2021-05-06 13:51:56 -13 33 20 46
portfolio_id man_id d_id m_type m_dt ins_amount p_tot_prev total
1 1 1000 D 2021-05-06 13:51:55.742666+01 11111111 33 11111144
1 rows affected
p_id mid d_id typ m_dt amount t_prev d_tot t_t
1 1 1000 D 2021-05-06 13:51:56 33 0 33 33
2 1 1000 C 2021-05-06 13:51:56 -13 33 20 46
3 1 1000 D 2021-05-06 13:51:56 30 20 50 76
portfolio_id man_id d_id m_type m_dt m_amount
3 1 1000 D 2021-05-06 13:51:55.744723+01 1
1 rows affected
p_id mid d_id typ m_dt amount t_prev d_tot t_t
1 1 1000 D 2021-05-06 13:51:56 33 0 33 33
2 1 1000 C 2021-05-06 13:51:56 -13 33 20 46
3 1 1000 D 2021-05-06 13:51:56 30 20 50 76
4 1 1000 D 2021-05-06 13:51:56 75 50 125 151
1 rows affected
p_id mid d_id typ m_dt amount t_prev d_tot t_t
1 1 1000 D 2021-05-06 13:51:56 33 0 33 33
2 1 1000 C 2021-05-06 13:51:56 -13 33 20 46
3 1 1000 D 2021-05-06 13:51:56 30 20 50 76
4 1 1000 D 2021-05-06 13:51:56 75 50 125 151
5 1 1000 C 2021-05-06 13:51:56 -25 125 100 176