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?.
4 rows affected
6 rows affected
6 rows affected
customer_id | region_id | created |
---|---|---|
1 | 73 | 2021-05-18 |
2 | 73 | 2021-06-10 |
3 | 73 | 2021-07-11 |
4 | 63 | 2021-07-11 |
application_id | credit_date | customer_id | back_date | credit_sum |
---|---|---|---|---|
101 | 2021-05-18 | 1 | 2021-05-28 | 4000.00 |
102 | 2021-07-10 | 2 | 2021-08-01 | 12000.00 |
1021 | 2021-07-12 | 2 | 2021-08-03 | 12000.00 |
103 | 2021-07-11 | 3 | 2021-08-03 | 7000.00 |
1031 | 2021-07-11 | 3 | 2021-08-07 | 12000.00 |
104 | 2021-07-11 | 4 | 2021-08-11 | 5000.00 |
application_id | created_at | payment |
---|---|---|
101 | 2021-05-28 | 4000.00 |
102 | 2021-07-17 | 4000.00 |
102 | 2021-07-25 | 4000.00 |
102 | 2021-07-29 | 4000.00 |
103 | 2021-07-29 | 4000.00 |
1031 | 2021-07-31 | 4000.00 |
customer_id | application_id | credit_date | back_date | credit_sum | cum_credit |
---|---|---|---|---|---|
1 | 101 | 2021-05-18 | 2021-05-28 | 4000.00 | 4000.00 |
2 | 102 | 2021-07-10 | 2021-08-01 | 12000.00 | 12000.00 |
2 | 1021 | 2021-07-12 | 2021-08-03 | 12000.00 | 24000.00 |
3 | 103 | 2021-07-11 | 2021-08-03 | 7000.00 | 19000.00 |
3 | 1031 | 2021-07-11 | 2021-08-07 | 12000.00 | 19000.00 |
4 | 104 | 2021-07-11 | 2021-08-11 | 5000.00 | 5000.00 |
customer_id | back_date | cum_debt |
---|---|---|
1 | 2021-05-28 | 4000.00 |
2 | 2021-08-01 | 12000.00 |
2 | 2021-08-03 | 24000.00 |
3 | 2021-08-03 | 7000.00 |
3 | 2021-08-07 | 19000.00 |
4 | 2021-08-11 | 5000.00 |
customer_id | application_id | payment_date | payment | cum_payment |
---|---|---|---|---|
1 | 101 | 2021-05-28 | 4000.00 | 4000.00 |
2 | 102 | 2021-07-17 | 4000.00 | 4000.00 |
2 | 102 | 2021-07-25 | 4000.00 | 8000.00 |
2 | 102 | 2021-07-29 | 4000.00 | 12000.00 |
3 | 103 | 2021-07-29 | 4000.00 | 4000.00 |
3 | 1031 | 2021-07-31 | 4000.00 | 8000.00 |