Slackbot
02/26/2023, 6:42 PMApoorv Gupta
02/27/2023, 5:11 AMJohn Kowtko
02/27/2023, 6:57 AMSelect a.key, a.col_A - a.col_B diff
from tableA a
join tableB b on a.key = b.key
and did an explain plan to generate the native query JSON, and it looks like it turned it into a scan with virtual column, which is what you are using.
I don't know of any other performant way of doing this. Is this a 1-1 join between the two tables or are them multiple matches for each key?Apoorv Gupta
02/27/2023, 11:44 AMApoorv Gupta
02/27/2023, 11:48 AMBen Krug
02/27/2023, 7:43 PMJohn Kowtko
02/27/2023, 8:32 PMApoorv Gupta
02/28/2023, 5:00 AMJohn Kowtko
02/28/2023, 12:50 PM"virtualColumns": [
{
"type": "expression",
"name": "v0",
"expression": "(added - j0.added)",
"outputType": "LONG"
}
],
It's worth trying out a few just to see what works and what doesn't. You should find the rules are pretty consistent here.