Skip to content

Commit 766908b

Browse files
committed
In-Memory OLTP sample
1 parent 8b57c7d commit 766908b

File tree

4 files changed

+69
-1
lines changed

4 files changed

+69
-1
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Sample performance with In-Memory OLTP in WideWorldImporters
2+
3+
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.
4+
5+
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.
6+
7+
### Contents
8+
9+
[About this sample](#about-this-sample)<br/>
10+
[Before you begin](#before-you-begin)<br/>
11+
[Running the sample](#run-this-sample)<br/>
12+
[Sample details](#sample-details)<br/>
13+
[Disclaimers](#disclaimers)<br/>
14+
[Related links](#related-links)<br/>
15+
16+
17+
<a name=about-this-sample></a>
18+
19+
## About this sample
20+
21+
<!-- Delete the ones that don't apply -->
22+
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
23+
1. **Key features:** Core database features
24+
1. **Workload:** single-threaded insert
25+
1. **Programming Language:** T-SQL
26+
1. **Authors:** Greg Low, Jos de Bruijn
27+
1. **Update history:** 25 May 2016 - initial revision
28+
29+
<a name=before-you-begin></a>
30+
31+
## Before you begin
32+
33+
To run this sample, you need the following prerequisites.
34+
35+
**Software prerequisites:**
36+
37+
<!-- Examples -->
38+
1. SQL Server 2016 (or higher) or Azure SQL Database.
39+
2. The WideWorldImporters database.
40+
41+
<a name=run-this-sample></a>
42+
43+
## Running the sample
44+
45+
1. Execute the script in SSMS.
46+
47+
2. Observe the time taken for the inserts in disk-based and memory-optimized tables.
48+
49+
## Sample details
50+
51+
52+
53+
<a name=disclaimers></a>
54+
55+
## Disclaimers
56+
The code included in this sample is not intended to be used for production purposes.
57+
58+
<a name=related-links></a>
59+
60+
## Related Links
61+
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
62+
TBD
63+
10.1 KB
Binary file not shown.

samples/databases/wide-world-importers/workload-drivers/vehicle-location-insert/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ To run this sample, you need the following prerequisites.
4747

4848
2. Build the solution.
4949

50-
3. Run the app.
50+
3. Connect to the database and
51+
52+
4. Run the app and follow the instructions on-screen. Compare the time taken for On Disk and In Memory insertion.
5153

5254
## Sample details
5355

@@ -63,6 +65,9 @@ You can control the number of threads performing the insert operations. You can
6365

6466
The application will periodically (about every second) display the latest execution times for each insert.
6567

68+
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:
69+
70+
ALTER DATABASE WideWorldImporters SET DELAYED_DURABILITY=FORCED
6671

6772
<a name=disclaimers></a>
6873

12.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)