Skip to Content
0

How to defragment the IQ database

Feb 27, 2017 at 03:40 PM

79

avatar image
Former Member

Hi

How to defragment the IQ database,

I created hundreds of tables,the catelog db size grew by 50MB,

when i drop all tables,

the catelog db size no reduction, but increased some.

Thanks

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

avatar image
Former Member
Feb 27, 2017 at 05:57 PM
0

The IQ catalog store is managed by SQL Anywhere. The size does not shrink if you delete data from the catalog db. In fact, an empty page is marked as free in the catalog store for future used. The only way to reduce the size of the catalog store is to rebuild it.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 28, 2017 at 03:10 AM
0

Hi Christine Zhong

Whether there is a tool to get to empty page information,

Check those that can be used repeatedly, those that can not be reused.

Whether follow-up plans to provide similar defragmentation tools.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member
Mar 02, 2017 at 02:10 PM
0

Why is 50MB of space an issue when IQ can store TB of data in the IQ dbspaces?

Are you creating the tables in 'SYSTEM' dbspace by any chance instead of the IQ dbspaces?

With respect to the IQ catalog (.db) file, what you should be more careful of, is the size of the catalog transaction log (.log) file. This can actually grow much larger than the .db file, and given the higher frequency of IQ catalog checkpoints, will mostly contain already committed and checkpointed transactions. This may grow large and can be truncated with the backup utilities to keep it smaller (this transaction log only manages transactions for the catalog only, not for IQ as a whole. There is a completely different mechanism for logging data changes in IQ dbspaces). Reducing the size of the catalog .log file can improve IQ startup times.

As far as actual defragmentation is concerned, again, don't worry about the catalog store. It is used as a metadata store for IQ operations and does not (or should not) contain any user data. The SQLA engine that manages the catalog store will reuse space, if available, instead of allocating more space. 50MB of catalog is small enough to most likely fit into the catalog cache (-c) memory by default anyway, so performance of this filesystem based storage will not be heavily impacted.

As far as the IQ dbspaces, again, they are already allocated. IQ efficiently manages this space and will reuse blocks and pages that are empty. I would not try to second guess the IQ allocation mechnisms for the various indexes, etc. If you are concerned about needing to defragment already-allocated tables, you can use the sp_iqrebuildindex stored procedure to optimize placement of already loaded data.

Chris

Share
10 |10000 characters needed characters left characters exceeded