In-Memory OLTP sample

This commit is contained in:
Jos de Bruijn
2016-05-26 14:04:51 -07:00
parent 8b57c7d0a3
commit 766908b429
4 changed files with 69 additions and 1 deletions
@@ -0,0 +1,63 @@
# Sample performance with In-Memory OLTP in WideWorldImporters
This script simulates an insertion workload for vehicle location in the WideWorldImporters sample database. Note that this script is single-threaded. For a multi-threaded variant, see the [vehicle-location-insert](../../workload-drivers/vehicle-location-insert) workload driver.
The main purpose is to compare the performance of data insertion into traditional disk-based tables compared with memory-optimized tables. For a more comprehensive sample demonstrating the performance of In-Memory OLTP see the [in-memory/ticket-reservations](/samples/features/in-memory/ticket-reservations) sample.
### Contents
[About this sample](#about-this-sample)<br/>
[Before you begin](#before-you-begin)<br/>
[Running the sample](#run-this-sample)<br/>
[Sample details](#sample-details)<br/>
[Disclaimers](#disclaimers)<br/>
[Related links](#related-links)<br/>
<a name=about-this-sample></a>
## About this sample
<!-- Delete the ones that don't apply -->
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
1. **Key features:** Core database features
1. **Workload:** single-threaded insert
1. **Programming Language:** T-SQL
1. **Authors:** Greg Low, Jos de Bruijn
1. **Update history:** 25 May 2016 - initial revision
<a name=before-you-begin></a>
## Before you begin
To run this sample, you need the following prerequisites.
**Software prerequisites:**
<!-- Examples -->
1. SQL Server 2016 (or higher) or Azure SQL Database.
2. The WideWorldImporters database.
<a name=run-this-sample></a>
## Running the sample
1. Execute the script in SSMS.
2. Observe the time taken for the inserts in disk-based and memory-optimized tables.
## Sample details
<a name=disclaimers></a>
## Disclaimers
The code included in this sample is not intended to be used for production purposes.
<a name=related-links></a>
## Related Links
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
TBD
@@ -47,7 +47,9 @@ To run this sample, you need the following prerequisites.
2. Build the solution.
3. Run the app.
3. Connect to the database and
4. Run the app and follow the instructions on-screen. Compare the time taken for On Disk and In Memory insertion.
## Sample details
@@ -63,6 +65,9 @@ You can control the number of threads performing the insert operations. You can
The application will periodically (about every second) display the latest execution times for each insert.
If there is no significant performance difference, this could be an indication of a log IO bottleneck, as each insert results in a transaction commit that involves a flush to disk. It is possible to work around using [delayed durability](https://msdn.microsoft.com/library/dn449490.aspx) in the database:
ALTER DATABASE WideWorldImporters SET DELAYED_DURABILITY=FORCED
<a name=disclaimers></a>