 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
[ES] - Inserting multiple joins into editor |
|
When selecting a table from a JOIN popup, if there are multiple foreign keys defined, SA inserts the JOIN either for the foreign key selected from the popup or inserts all the possible JOINs if the table is selected. However, while for the first JOIN the type of the JOIN entered into the editor is respected, the rest of the JOINs are added as a plain (INNER) JOIN. This might be both good or bad as SA could not read minds to decide which type of JOINs to use beyond the one that was explicitly given by the user but my own statistics show a trend that all those joins tend to be of the same type.
Check this short video here.
Last edited by gemisigo on Wed Oct 13, 2021 12:02 pm; edited 1 time in total |
|
Wed Oct 13, 2021 6:02 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
*If* I get it correctly, in your last example only one join had to be inserted, for the selected table only. I see two joins inserted as if the top line was selected, which is not what I think I see in the video.
The expected behavior is like this. It's triggered by the JOIN keywords, the type of join isn't relevant, it's not yet that smart to analyze the type.
1. If you select the first line with the name of the table for which joins are shown, it should insert all of them, or if there is a filter, then only for the filtered tables including all columns referenced in the joins
2. If you select one of the tables in the list, then just one join is supposed to be inserted with all its columns (that's your last example), should be one join with two columns in it
3. If you select a specific column, then only one join is supposed to be inserted with one selected column referenced only.
I all scenarios, it doesn't yet pay attention to the text before the JOIN keyword in order to figure out join type. That would be an enhancement.
Last edited by SysOp on Wed Oct 13, 2021 12:29 pm; edited 2 times in total |
|
Wed Oct 13, 2021 9:00 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Some clarifications are needed:
- in each of the three examples the table kar_validation_transaction (AS kvt) was left joined to the table kr_tariff_zone (AS ktz)
- there are two foreign keys defined between those two tables, both kvt.origin_zone_tid and kvt.destination_zone_tid point to (possibly different) zones, not a single foreign key with two columns
- in the first example I selected one of the foreign keys, in the second one the other foreign key and in the third, I choose the table instead of one of the foreign keys
- in all three examples the number of the inserted joins was as expected, in the third example, it added the table twice, one for both of the foreign keys. SA inserted just what I wanted
- the only thing I'd expected different was the JOIN keyword inserted for the subsequent JOIN
And yes, you're right I intended this as an enhancement suggestion, not as a remark to the beta. My bad, I'm very sorry, I'm updating the topic title now.
|
|
Wed Oct 13, 2021 12:01 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
I'm sorry I didn't mean to object to what you mentioned. My intention was to state that it doesn't respect OUTER join because it's not yet smart enough to figure out that it can follow the join type specified, right now it's more or less a cookie cutter logic, same size, always does "JOIN etc..." Of course I will follow up and enter an enhancement request to propagate to subsequent joins the same join type as in the first case
|
|
Wed Oct 13, 2021 12:34 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|