• milos.radivojevic (4/2/2014)


    As with disk tables we would need your CREATE TABLE statement for the memory optimized table to check the table and index definition.

    Since the ALTER TABLE statement is not supported at all you need to define at the creation time not only table structure but also all indexes you would need later for queries against the table. In addition for hash indexes you have to provide boucket count. If you miss any of this (indexes and bucket_count) performance can be significantly decreased compared to disk tables.

    In-memory tables are optmized for point lookup queries and these queries use hash indexes. Range queries (operator LIKE) require range indexes. If you did not create them a full scan is performed. The same happens for SELECT COUNT(*) - index scan (scanning of hash index on primary key). A hash index seek is used only for predicates with Equals operator. If you need more concrete answer please provide the CREATE TABLE statement for MO table.

    Thanks for taking the time to post that.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)