When a new table join is made, the logic ensures that if the table on the right has a lower priority number than the table on the left the priority of the table on the right will be rewritten to be the same as the table on the left but with an increment of 0.5.
The list of tables is then re-ordered based on the priority numbers, with each priority number being displayed as an integer.
If a new table is inserted into the middle of the existing list of tables, all tables that come after the newly inserted table will have their priority numbers increased by 1 regardless of there being a space or not.
In the following example:
Table A - Priority 999
Table B - Priority 999.5 (a newly inserted table, where a join was made with Table A which was to the left of the newly inserted table)
Table C - Priority 1000
Table D - Priority 1009
Table E - Priority 1010
To ensure that all tables are displayed in the correct order and all priority numbers are integers the tables would be re-ordered and displayed as follows:
Table A - Priority 999
Table B - Priority 1000
Table C - Priority 1001
Table D - Priority 1010
Table E - Priority 1011
Add Comment