TableType Property - Tables in D365

 

TableType Property - Tables in D365

This unit explains temporary tables, the different types of temporary tables, and when they should be used.

Temporary tables allow you to efficiently create and clean up temporary data. The two types of temporary tables are:

  • InMemory
  • TempDB
TableType Property - Tables in D365

The table type can be determined on the table's TableType property.

TableType Property

The following table describes the TableType property.

Value

Description

Regular

The default value. These are permanent tables.

Temporary InMemory

A temporary table that exists as an indexed sequential access method (ISAM) file. The ISAM file can exist on either the client tier of the Application Object Server (AOS) tier. The underlying Microsoft SQL Server has no connection to the ISAM file.

The data is stored in memory until it reaches 128 KB, and then the dataset is written to a disk file on the server tier. InMemory tables are instantiated when the first record is inserted. The table exists and memory is only allocated to the table while a record buffer exists.

The system does allow you join an InMemory table in the X++ SQL syntax. However, joins and other set operations with InMemory tables are usually inefficient.

For more information, see Temporary InMemory Tables.

An InMemory table is the same thing as what was previously called a temporary table in Microsoft Dynamics AX 2009.

An InMemory table might be used when you need to store and retrieve data without writing data to the database. This is like a container, but InMemory tables allow you to use indexes to speed up data retrieval. If you are only using a few records, you should use a container, not an InMemory table. You can use X++ SQL syntax to join an InMemory table, however, joins and SQL operations are usually inefficient.

Temporary TempDB

A temporary table that resides in the TempDB database of the underlying SQL Server. The nonstandard format of a TempDB table causes the table to be dropped when it is no longer in use by the current method.

Joins and other set operations on TempDB tables can be efficient.

For more information, see Temporary TempDB Tables.

TempDB tables use the TempDB database of the SQL Server. This type of table causes the data to be removed when it is no longer used by the current method or when the system is restarted. Regular tables are automatically turned into TempDB tables by disabling the configuration key for the table, which allows references to the disabled table in the system to continue to compile and run. Additionally, TempDB tables are commonly used on reports to manipulate data.

The capabilities of TempDB tables include the following:

  • Joining to regular tables.
  • Using foreign keys.
  • Being per company or global.
  • Having indexes.
  • Having methods but an inability to override the methods.
  • Instantiating from the client or server tier.
  • Being used as a query.
  • Having no requirements for a configuration key.

TempDB tables also have the following limitations:

  • Inability to manage date-effective data.
  • They do not contain delete actions.
  • Record Level Security does not apply.
  • You cannot use them in views.

Comparison between Regular, InMemory and TempDB TableType Property in d365

Here's a comparison of the RegularInMemory, and TempDB table types in Dynamics 365 in a table format:

Property/FeatureRegular TableInMemory TableTempDB Table
Storage LocationApplication DatabaseMemorySystem Database
PersistenceData is persisted to diskData is stored in memory and lost on restartData is lost when the table is no longer needed
Use CasesPermanent storage of application dataFast processing of temporary dataFast processing of temporary data
ScalabilityLimited by disk performance and database server capacityLimited by memory capacity of serverLimited by disk performance and database server capacity
Query PerformanceCan be optimized with indexes and other database tuning techniquesFast due to in-memory storage, but cannot be optimized with indexes or other database tuning techniquesCan be optimized with indexes and other database tuning techniques
SecuritySupports standard database security featuresSupports standard database security featuresSupports standard database security features
Transaction HandlingSupports standard database transactionsDoes not support transactionsSupports standard database transactions
Data SizeLimited by disk capacity of serverLimited by memory capacity of serverLimited by disk capacity of server

Differences between Regular, InMemory and TempDB TableType Property in d365

Here's a table format response that highlights some of the key differences between RegularInMemory, and TempDB table types in Dynamics 365:

Property/FeatureRegular TableInMemory TableTempDB Table
Storage LocationApplication DatabaseMemorySystem Database
PersistenceData is persisted to diskData is stored in memory and lost on restartData is lost when the table is no longer needed
Use CasesPermanent storage of application dataFast processing of temporary dataFast processing of temporary data
IndexingSupports standard database indexingDoes not support indexesSupports standard database indexing
Transaction HandlingSupports standard database transactionsDoes not support transactionsSupports standard database transactions
Data SizeLimited by disk capacity of serverLimited by memory capacity of serverLimited by disk capacity of server
PerformanceGenerally slower than in-memory tablesGenerally faster than regular tablesGenerally faster than regular tables
ScalabilityLimited by disk performance and database server capacityLimited by memory capacity of serverLimited by disk performance and database server capacity
SecuritySupports standard database security featuresSupports standard database security featuresSupports standard database security features
AvailabilityAlways availableAlways availableAvailable only during specific process or operation

Note that this is not an exhaustive list and there may be other differences between these table types depending on the specific needs of your Dynamics 365 implementation.


Comments