Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3773

Optimizing Database

$
0
0

I need some advice.
In SQLite I optimize the database with

DB.SQLExecute("VACUUM;")  'Speicher freigeben und Datenbank defragmentieren / rebuild database file, repacking it into a minimal amount of disk space
DB.SQLExecute("ANALYZE;") 'Zugriffspfade optimieren / gather statistics for optimization of queries

To do the same in MS SQL Server, I try to optimize the database like this:

// Speicher freigeben und Datenbank defragmentieren  / rebuild database file, repacking it into a minimal amount of disk space
DB.ExecuteSQL("DBCC SHRINKDATABASE('"+DB_Name+"') TRUNCATEONLY;")

// Zugriffspfade optimieren / gather statistics for optimization of queries
DB.ExecuteSQL("ANALYZE TABLES COMPUTE STATISTICS;") 

Is this correct and/or am I missing something?

At the moment I can’t test my MS SQL Server DB because I’m still waiting for the ODBCDatabase to be corrected (Xojo 2024r1 with #75322)!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3773

Trending Articles