Concurrency of update statistics

  • N_Muller

    SSCarpal Tunnel

    Points: 4035

    Statistics on memory optimized tables are created at the time of table creation and never updated.  That means that all statistics are created on empty table.  In order to update index statistics on memory optimized tables I need to manually run UPDATE STATISTICS statement.

    The memory optimized tables I have are created with schema-only durability.  Data in the tables is volatile. It is used by stored procedures and, in order to manage data growth, I have a job that deletes records from the table when data is no longer needed.  The tables are used in a couple of stored procedures that don't run very frequently.  Since most of the time the table is empty, updating statistics on a scheduled job won't do any good.  Instead, I have the update statistics inside the procedures.

    Every once in a while I get an error saying Cannot find object "Table_Name"... where the table name is my memory optimized table. The table exists and the only thing I can think of is the UPDATE STATISTICS statement.

    Is there a concurrency issue with the UPDATE STATISTICS statement?  What happens if a procedure call is running the UPDATE STATISTICS statement while another instance of the procedure is trying to either use or update statistics on the same table?  Would that throw this error?

    Thank you in advance.

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply