Reduce fragmentation

Fragmentation occurs naturally as you make changes to your database. Performance can suffer if your files, tables, or indexes are excessively fragmented. Reducing fragmentation becomes more important as your database increases in size. SQL Anywhere contains stored procedures that generate information about the fragmentation of files, tables, and indexes.

If you are noticing a significant decrease in performance, consider:

  • rebuilding your database to reduce table and/or index fragmentation, especially if you have performed extensive delete/update/insert activity on a number of tables
  • putting the database on a disk partition by itself to reduce file fragmentation
  • running one of the available Windows utilities periodically to reduce file fragmentation
  • reorganizing your tables to reduce database fragmentation
  • using the REORGANIZE TABLE statement to defragment rows in a table, or to compress indexes which may have become sparse due to DELETEs. Reorganizing tables can reduce the total number of pages used to store a table and its indexes, and it may reduce the number of levels in an index tree as well.

Reducing file fragmentation
Reducing table fragmentation
Reducing index fragmentation and skew