SQL Server optimisation for Sage X3: indexes, statistics and compatibility level
Sage X3 runs on an SQL Server database, and a large part of its speed is decided there. Three levers come up almost every time this database is optimised: indexes, statistics and the compatibility level. They are technical, but their logic is simple to grasp, and grasping that logic helps you ask your provider the right questions. These levers are powerful, so you never touch them blind.
Indexes: finding without scanning everything
An index is to a table what an index is to a book: it lets you go straight to the right page without reading the whole volume. Without the right index, SQL Server scans entire tables on every search, which is slow as soon as the volumes grow.
But an index is not free. Too many indexes, or poorly chosen ones, slow down writes and consume space. The point is therefore not to add them everywhere, but to add the right one where a costly query calls for it, and to remove those that no longer serve. It is a trade-off, not a reflex.
Statistics: choosing the right path
For each query, SQL Server chooses an execution plan: the strategy it judges fastest. It bases that choice on statistics describing the distribution of your data. If those statistics are out of date, because the volumes have changed a lot, it chooses badly, and a query that should be fast takes a wrong path.
Up-to-date statistics are often the most rewarding fix: low-risk, and sometimes spectacular on a given query. It is one of the first things an audit looks at after a migration, because a version upgrade often invalidates or rebuilds statistics.
Compatibility level: which optimiser
A database's compatibility level tells SQL Server which generation of behaviour to adopt, notably which query optimiser to use. After a migration, a repositioned compatibility level can change the plan chosen for a query, for better or for worse. It is a frequent and insidious cause of post-migration regression, because it does not show until you compare the before and the after.
SQL is only half the story
Optimising the database is necessary, but not always sufficient for a Sage X3. The market often separates the Sage integrator from the SQL DBA, and that is precisely where slowness persists: a heavy query can be issued by a specific process that no database setting will fix. X3 Optimizer brings the two skills together, SQL Server and Sage X3, in the same hand, and its internal decompiler reads the L4G code that actually runs to trace back to the line that issues the costly query.
Read-only, aligned with Sage good practice and without amounting to a certification, X3 Optimizer delivers a sourced diagnosis: which query consumes, why, and who owns the fix. SYAGA analyses and recommends; the implementation is the job of your integrator or your teams.