Commit fa6a79d
authored
Use NVARCHAR for SQL Server
I observed that the SQL Server DDL for Spring Integration metadata tables defines several critical key columns (e.g., REGION, GROUP_KEY, METADATA_KEY) using the VARCHAR data type.
This configuration creates a type mismatch because the Microsoft JDBC Driver, by default, sends string parameters to SQL Server using the Unicode (NVARCHAR) data type.
Potential Impact and Optimization:
This mismatch necessitates an Implicit Conversion by SQL Server on nearly every lookup.
While functional, this conversion can severely compromise the database's ability to utilize indexes optimally.
In high-frequency queries involving these key columns, this often forces the database to revert from efficient Index Seek to less efficient Index Scan or Table Scan.
We propose adjusting the relevant VARCHAR columns in the DDL to NVARCHAR.
This structural alignment eliminates the potential for implicit conversion, ensuring the DDL is consistent with the parameters sent by the MS JDBC driver, and guaranteeing optimal index utilization.
Signed-off-by: Chienlin <[email protected]>1 parent ba83769 commit fa6a79d
File tree
1 file changed
+9
-9
lines changed- spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc
1 file changed
+9
-9
lines changedLines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
0 commit comments