Listening to table and catalog events – Pitney Bowes MapXtreme User Manual

Page 164

Advertising
background image

Chapter 8: Working with Data

Working with Catalog and Tables

MapXtreme v7.1

171

Developer Guide

RebuildGeometry – Rebuilding the geometry objects removes unused space that has resulted
from a series of insert, update, and/or delete operations. Unlike packing the geometry objects,
this option intentionally leaves unused space in the RTree index to improve the performance of
future insert and update operations.

PackIndex – Non-spatial indices are maintained as B*trees. These structures do not always
have filled internal or leaf nodes. This is intentional by default to allow room for the index to
accommodate insert and update operations without requiring a significant restructuring of the
index. The unused space may be exacerbated by the occurrence of insert, update, or delete
operations. Packing an index fully packs every internal and leaf node (except possibly the “last”
node). This option reduces the disk space used by the index as much as possible and also
improves the read-performance of the index. There is a performance penalty for insert and
update operations on a fully packed index.

RebuildIndex – Rebuilding an index does not fully pack the internal and leaf nodes like the
PackIndex option. Instead, rebuilding an index recreates the index with the amount of unused
space that is intentionally put into the index to balance disk space, read performance, and modify
performance. After several modification operations, an index may contain a considerable amount
of unused space. This option regains that unused space.

RemoveDeletedRecords – Some data sources, including MapInfo Native and dBase data
sources, do not physically remove records when they are deleted. To physically remove the
deleted records, the table must be packed with this option specified. The record number is
typically used as the record key for these data source types. Removing deleted records from a
table may cause keys to become invalid since they may change as a result of the pack.

CompactDb – If the table's data source is Microsoft Access (TableType of Access), then the MDB
file containing the table's data may also be compressed using the Pack method and specifying
this option.

All – This is a convenience option that is equivalent to PackGeometry | PackIndex |
RemoveDeletedRecords.

Listening to Table and Catalog Events

Table exposes several events which applications may subscribe to. They are:

RowInsertedEvent – Occurs when a new row is added to the table.

RowUpdatedEvent – Occurs when an existing row in the table is updated.

RowDeletedEvent – Occurs when a row in the table is deleted.

TablePackedEvent – Occurs when the table is packed.

TableCloseRequestEvent – Occurs when the table has been asked to close.

TableIsClosingEvent – Occurs when the table is closing.

TableClosedEvent – Occurs when the table is closed.

Catalog also exposes the following events.

TableOpenedEvent – Occurs when a table is opened.

TableCreatedEvent – Occurs when a new table is created.

TableIsClosingEvent – Occurs when the table is closing.

Advertising