|MapInfo Pro v15 - Taking Advantage of Smart Indexing
||Smart Indexing is a new performance improvement that can reduce the time required to complete large edits to your tables.
This article will provide some details behind this capability but for many users the default option will work very well.
MapInfo Pro Version 15.0 and 15.2
Smart Indexing pertains to both v15.0 (the latest 32 bit release) and v15.2, our upcoming 64 bit release scheduled for late October.
Background: What is an index?
Indices on MapInfo tables are created to facilitate operations such as the Find command as well as the creation of thematic maps.
An index can be created for one or more columns in a table and provides rapid searching and efficient ordered access to a table.
What is Smart Indexing?
For some data operations, it is more efficient to first disable the indices, make the changes to the data and then rebuild the indices.
This approach can often improve performance and in some cases the improvement is dramatic. However, this approach isn't always faster hence the need for smart rules which determine when it is used. For example, making a single edit to a value or adding a single row to a table would be slower if we rebuilt the index.
This new capability is beneficial in some situations where large amounts of data are being edited.
Smart Indexing explained
The new Smart Indexing capability works according to the following rules by default.
Where a table contains more than 1000 rows and where more than 0.1% of the total number of rows are being updated then MapInfo Pro will not edit the existing index/indices but instead will rebuild the index.
There are many factors that influence performance when editing a table, including the nature of the indices involved and the number of columns indexed. A longer character field may require more processing time than a shorter character field.
Smart Indexing has been implemented for the following operations:
It is not used for Combine Objects Using Column.
- Update column
- Combine selected objects
- Erase outside
- Line split operations
Smart Indexing Preference
It is possible that Smart Indexing might not be used where it could be of benefit. It is also possible for an operation to take a little bit more time than it otherwise would if Smart Indexing is used. In the event that this happens, you can change the behaviour through a preference.
This preference is found in the Performance options. Look in Options > Preferences > Performance in v15.0. When v15.2 is released, look in the Options tab in the Backstage area.
Auto: Operates by the rules described above.
Off: Means that Smart Indexing is not used in any circumstances.
On: Means that Smart Indexing is always used.
Smart Indexing Examples
Here are some example comparisons. These were performed on a Dell E6420 laptop with four dual core 2.2 Ghz processors and 8 GB RAM.
Note that there is an example where v15.0 was slower in one case of deleting data. In a different case where two columns are indexed in the table, there is a significant performance improvement when the indices are rebuilt.
We do not expect there to be many cases where this new capability results in slower performance but the choice on when or when not to rebuild indices is difficult to get perfect in every single circumstance. Once again, we have implemented a preference option should it be required to control this behaviour.
A note about Appending, Disaggregating and Splitting tables
The "Auto" preference for Smart Indexing will never rebuild the index for these operations. The reason is that operations that add new values to a table do not create a lot of overhead in managing indices. Performance is not likely to be enhanced.
It is expected to be rare but you can set the Smart Indexing Preference to "On" should you determine that one of the above operations could be improved.
Managing indices where data is being deleted requires more overhead and more commonly creates situations where Smart Indexing can make a difference in performance.
A note for MapBasic programmers
For those of you who write MapBasic code or who use the MapBasic window, this new capability is fully supported in the MapBasic language. Here is an example delete statement showing all three options.
Delete from Selection DROPINDEX AUTO
Delete from Selection DROPINDEX ON
Delete from Selection DROPINDEX OFF
Want to learn more about MapInfo Pro v15.0?
Check out this overview which appeared in the July 2015 issue.
Not using the latest version? Download a free trial.
Visit http://web.pb.com/miprov15 where you can download a free trial of the 32-bit release of MapInfo Pro v15.0.
Or, if you prefer, the 64 bit release of v12.5 is also available from the same page. Note that this release does not have Smart Indexing in it yet but it does have a new ribbon based user interface with many enhancements. Our next 64 bit release is v15.2 and is scheduled for October 2015.
You can try both as they can run "side by side".
Article by Tom Probert, Editor of "The MapInfo Professional" journal
When not writing articles for "The MapInfo Professional", Tom enjoys talking to MapInfo Professional users at conferences and events. When not working he likes to see movies with car chases, explosions and kung-fu fighting.