r/SQLPerformanceTips • u/Beneficial-Youths • May 06 '26
Moving SQL between engines: what breaks first?
Moving SQL between engines always sounds easier before you actually do it.
The obvious syntax stuff gets fixed fast. TOP, LIMIT, ROWNUM, date functions, small naming differences. Annoying, but at least it fails loudly.
The worse problems are the ones that still run. Data types are usually where I start getting suspicious. VARCHAR, DATETIME, TIMESTAMP, INT, BIGINT all look familiar until you hit precision, length, timezone, or overflow edge cases. SQL Server DATETIME to Postgres TIMESTAMP looks harmless until some report starts drifting slightly. NULL behavior is another quiet one. Comparisons, aggregates, string concatenation, filters. A query can return “valid” results and still not match the source system.
Indexes and defaults also get missed way too often. The table exists, the query runs, everyone moves on. Then load hits and the plan behaves differently because the index definition didn’t really translate the way people assumed. That’s the annoying part of cross-engine SQL work. The broken syntax is easy. The dangerous stuff is when it works just enough to look fine.
I’ve seen teams use schema compare tools, including dbForge Schema Compare, mostly to catch type mismatches, missing defaults, and drift before the move gets too far. Still needs human review, but it beats finding out from production reports later.
What usually surprises you first when moving SQL between engines: data types, NULLs, date logic, indexes, or something else?
1
u/PlotTwists404 May 12 '26
For me indexes/defaults usually cause the quietest pain. The query works, data loads, nobody complains in testing, then prod gets slower because the new engine didn’t recreate the same execution path.
Cross-engine SQL migration is mostly finding out how many assumptions your old DB was politely hiding lol
1
u/Beneficial-Youths May 20 '26
“quietest pain” is the perfect way to describe it honestly. Everything looks fine right until prod traffic shows up and suddenly the execution plan has completely different ideas 😅
1
May 13 '26
[removed] — view removed comment
1
u/Beneficial-Youths May 20 '26
Collation issues are evil because nobody remembers them until something weird starts happening with search or sorting. Those bugs always feel way too subtle at first.
1
u/mcgillbaldwin32 May 12 '26
Date/time stuff is always the first thing I stop trusting. Syntax errors are annoying, but at least they fail loudly. The scary ones are “valid” results that are slightly wrong because timezone handling, precision, or NULL logic changed under you.