Other Software and Data

 View Only
  • 1.  MapXtreme slow to insert features compared to file load

    Posted 10-11-2021 14:51
    Using MapXtreme 9.2 in .NET I need to create a table and load 13000 features. Currently I create the features, adding them to a feature collection and then use
    table.BeginAccess(TableAccessMode.Write);
    table.InsertFeatures(newFeaturesCollection);
    table.EndAccess();
    This is taking on average around 6000ms.

    If I save the data to a TAB file and then open it using
    Session.Current.Catalog.OpenTable(tableinfo)
    it takes 29ms.

    Is it possible to improve the performance of InsertFeatures? Am I missing something? Why is the TAB file almost 6 seconds faster to load?


    ------------------------------
    Liz Walker
    ------------------------------


  • 2.  RE: MapXtreme slow to insert features compared to file load

    Posted 10-12-2021 09:25
    Hi Liz,

    InsertFeatures essentially inserts all the passed in features 1 by 1 into the table, create indexes for the indexed column and balance the tree. That is why it is taking time to insert.
    Whereas once you have a Tab file which means all the records are already inserted previously using some operation so opening a Tab file is quicker as there is no data insertion or indexing or any other operation happening while opening.
    Hope that clarifies your query.

    ------------------------------
    Dinesh Ahuja
    PITNEY BOWES SOFTWARE
    NOIDA
    ------------------------------



  • 3.  RE: MapXtreme slow to insert features compared to file load

    Posted 10-13-2021 07:16
    Hi Dinesh,

    Thank you for the answer. I understand why the Tab file is so quick now.

    I would however have expected to see some performance benefit from using table.InsertFeatures(featureCollection) as opposed to when I iteratively loop through the feature and use table.InsertFeature(newFeature) otherwise why is this additional method provided?  If inserting from a collection wouldn't things like the indexing only need to occur the once at the end? (as opposed to 13000 times with my data set)

    ------------------------------
    Liz Walker
    ------------------------------



  • 4.  RE: MapXtreme slow to insert features compared to file load

    Posted 10-13-2021 07:21
    I agree this could be considered as performance improvement implementation. This API is provided just for convenience purpose, but under the hood it pushes objects one by one. Underlying SQL query work on one row at a time.

    ------------------------------
    Dinesh Ahuja
    PITNEY BOWES SOFTWARE
    NOIDA
    ------------------------------