Torgsoft database optimization: indexes and statistics
Torgsoft Database Optimization: Benefits and When You Need It
Database optimization by rebuilding/reorganizing indexes and updating statistics is a mandatory service procedure to restore Torgsoft performance with large data volumes or after mass changes in the database.
This material is intended for users and system administrators who have basic skills working with the operating system, Windows services, and Microsoft SQL Server. All actions described are performed at your own risk: incorrect changes to settings, services, or the database can lead to data loss or the program becoming inoperable. Before making changes, it is recommended to create a current database backup, check free disk space, and make sure there are no active users in the system. If you are not confident in the correctness of your actions or do not understand the consequences — contact technical support.
When Optimization Is Mandatory: Time, Size, and Change Triggers
You should perform optimization if at least one factor applies:
-
the database has been actively used for more than 6–12 months,
-
mass operations were performed (product imports, inventory counts, log cleanup),
-
the database is approaching the SQL Server Express (10 GB) limit,
-
after a Torgsoft version update, significant slowdowns appeared.
Signs the Database Needs Optimization: Slow Forms, Reports, Errors, and the 10 GB Limit
Users typically complain about:
-
very long execution of certain operations (closing inventory counts, generating documents),
-
forms freezing in Stock Availability, Invoice-based Sales,
-
reports taking minutes to generate,
-
errors such as:
-
Arithmetic overflow
-
SQL filegroup is full,
-
the database size reaches 9–10 GB and write failures occur.
Causes of Slowdowns
-
Index fragmentation
Due to constant inserts/deletes, SQL uses inefficient execution plans. -
Outdated statistics
The SQL optimizer incorrectly estimates data volumes. -
Excess data
Old logs, closed-period statistics. -
SQL Server Express limitations
A hard 10 GB limit causes errors and performance degradation. -
Outdated SQL Server version (2005)
Does not support modern Torgsoft queries.
How to Speed Up the Database
1. Standard Optimization (Mandatory Minimum)
Run the service procedure:
File → Rebuild and Reorganize Indexes and Update Statistics
Result:
-
SQL generates new execution plans,
-
operation speed increases several times.
2. «Database Optimization» Mode (version 2022.0.48+)
For complex and «heavy» databases: File → Database Optimization
What happens:
-
Database Engine Tuning Advisor is used,
-
real slow queries are analyzed,
-
custom indexes are created specifically for your database.
Observed effect in practice:
-
forms speed up by 10–15x,
-
closing inventory counts: from hours to minutes.
3. If the Database Is Approaching 10 GB (SQL Express)
Mandatory actions:
-
Delete unnecessary logs:
-
User Actions Log,
-
Document Change Log (keep, for example, 3 months).
-
Delete closed-period statistics (code 006).
-
After that:
-
rebuild indexes,
-
run Shrink via SQL Server Management Studio.
Expected result:
-
database size reduced by 1.5–2x,
-
overflow errors disappear.
4. Check the SQL Server Version
-
SQL Server 2005 is not recommended; optimization may have little effect.
-
Minimum acceptable: SQL Server 2014.
Post-Optimization Check
After optimization:
-
forms open within seconds,
-
reports generate without delays,
-
users no longer experience freezes,
-
the database size stays stable and does not grow abnormally.
Future Prevention
-
run optimization every 3–6 months,
-
close periods regularly,
-
do not keep logs for years,
-
monitor database size,
-
use an up-to-date SQL Server version.
Summary: Action Rule
If Torgsoft starts slowing down, the first thing to do is optimize indexes and statistics.
If the database is large or close to 10 GB, do optimization + cleanup + shrink.
-
25.01.2026
Torgsoft-Hybrid Installation and Setup
Torgsoft-Hybrid setup guide: technical requirements, installation, hardware connection, and offline mode operation with subsequent data synchronization.
-
08.01.2026
Transferring Torgsoft to another computer or server
Transferring Torgsoft to another computer or server: backup, SQL database, license, settings and safe launch without data loss
-
06.01.2026
Torgsoft database optimization: indexes and statistics
How to speed up Torgsoft: optimizing indexes and SQL statistics, signs of need, when to perform and what to do with a 10 GB limit









Go back to the previous step