67 questions
0
votes
1
answer
66
views
Azure SQL Pricing Tiers - can we still reduce the Pricing Tier after creating a Memory Optimized Table? [closed]
One of our clients has a Azure SQL database running on a P1 Premium Pricing Tier.
I created a Memory Optimized table in this database, e.g.
CREATE
TABLE [dbo].[Foo]
([id] INT ...
-1
votes
1
answer
120
views
Using timestamp columns in a memory optimized table
I am researching how to convert some physical tables to memory-optimized tables.
But these tables have timestamp column.
This data type is not supported in MO. How to replace it? Now these columns ...
0
votes
0
answers
105
views
Why Table Spool on MemoryOptimized table and how to suppress it?
I am in the middle of the road to achieving an optimized query for faster execution, or at least I hope so. I stumbled upon a pattern (it looks strange to me) in the execution plan, which seems to be ...
0
votes
1
answer
153
views
How to delete cascade on Memory-Optimized tables?
I have 2 tables: master->detail, how can I implement 'delete cascade' like referential integrity on delete cascade for disk-based tables?
What way to use?
0
votes
1
answer
750
views
'TRANSACTION ISOLATION LEVEL is set to SNAPSHOT' error when using TransactionScope on Memory Optimised Table
In Memory disk setup on SQL Server with below up
snapshot_isolation_state
snapshot_isolation_state_desc
is_read_committed_snapshot_on
is_memory_optimized_elevate_to_snapshot_on
...
1
vote
1
answer
259
views
Avoid data loss on update while using Memory-Optimized Tables
My company main software have 90% of the business logic on the database (stored procedures). With the last version, Memory-Optimized Tables have been introduced to replace temporary tables used to ...
0
votes
0
answers
678
views
Memory Optimized table - Adding hash index with included fields
A number of indexes were dropped from a SQL Server 2017 memory-optimized table during a change a couple of months ago. Unfortunately it appears the source code for the original table is not available (...
0
votes
1
answer
1k
views
Insert into Memory Optimized Table from non optimized
I have two database.
Primary have a DDL triggers so i can't create memory optimized tables there. So i created secondary database and create there table with memory optimized on. Now, in procedure on ...
1
vote
2
answers
3k
views
The current transaction attempted to update a record that has been updated since this transaction started. The transaction was aborted
I'm trying to update a table which is In-Memory OLTP. There is a scenario where we may have to update a same row in parallel. During concurrent update of a same record I am getting below reported ...
0
votes
1
answer
49
views
Web config vs In-memory tables/memory optimized tables
In my web.config file for an ASP.NET web application, I have around 150 key-value pairs under <appsettings>. Should I convert this web.config file into an In-Memory table / Memory optimized ...
1
vote
0
answers
387
views
Cross-database query with memory memory-optimized tables
I am trying to tune a system by using memory optimized tables as a cache for frequently used data. The problem is that my system design has separate database (on the same server) siloed by core ...
1
vote
0
answers
67
views
Time consumption in Memory Optimize table
I have created one demo like- first created one temp table, then one In Memory table, then some insertion query to insert into the temp table, then used the same insertion query to insert into the In ...
1
vote
0
answers
252
views
How to return MEMORY OPTIMIZED table from UDF?
How to re-write the UDF returning table variable to the function returns memory-optimized type dbo.TypeOUT ?
DROP FUNCTION [dbo].[test01]
GO
CREATE FUNCTION [dbo].[test01] (@id int)
RETURNS @out ...
12
votes
1
answer
2k
views
Efficiently store large list structure in RocksDB so that the data can be retrieved in pages
Description:
RocksDB is a key-value storage so we can simply serialise the list of objects & store the value corresponding to a key. This would be ok if the data in the list is small enough.
But ...
1
vote
1
answer
379
views
Conditional Unique Constraint on Memory Optimized Tables
I am trying to keep integrity in a MEMORY OPTIMIZED table I have. In that table is a foreign key (uniqueidentifier) that points to another table and an Active flag (bit) denoting whether the record is ...
6
votes
2
answers
5k
views
SQL Server Memory Optimized Table - poor performance compared to temporary table
I'm trying to benchmark memory optimized tables in Microsoft SQL Server 2016 with classic temporary tables.
SQL Server version:
Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) Mar ...
5
votes
1
answer
2k
views
How do you change the DURABILITY option on an existing memory-optimized table in SQL Server 2016?
I want to change the DURABILITY of a memory-optimized table in SQL Server 2016 from SCHEMA_AND_DATA to SCHEMA_ONLY.
The Microsoft documentation suggests that the following ALTER TABLE statement ...
0
votes
2
answers
1k
views
Migration existing disk-based table to memory optimized table
We are developing a web application using ASP.NET MVC Core and using EntityFramework Core for data acess. .net core version is 2.2. Now, We are trying to use MemoryOptimizedTables in SQL server 2016 ...
26
votes
5
answers
19k
views
ALTER TABLE DROP INDEX failed on a table that isn't memory optimized
I'm trying to drop an index created on a table, but I get this error -
The operation 'ALTER TABLE DROP INDEX' is supported only with memory optimized tables.
I need to remove this index in order to ...
6
votes
2
answers
11k
views
SQL Server in-memory oltp transaction snapshot isolation
Trying to understand how transaction isolation levels work on SQL Server memory optimized tables (in-memory oltp).
If I execute the following query:
SET TRANSACTION ISOLATION LEVEL READ COMMITTED
...
0
votes
0
answers
190
views
Fetching records that are not being updated SQL Server
I have an API that multiple processor requests work from. The job of the the API is to select records from a memory optimized table and mark the status assigned and hand it off to the requester. I ...
2
votes
0
answers
101
views
Issues with statistics on memory optimized tables and query plan on natively-compiled stored procedures
Memory Optimized tables:
It is my understanding that statistics on memory optimized (MO) tables are created at the time the table is created and is empty, and it never updates. In order to update ...
2
votes
1
answer
428
views
Populate schema_only table with some initial values
Is it possible populate a schema_only table (with some initial values) when the database starts, e.g. by invoking a stored procedure?
The logic that normally operates on this table would be more ...
2
votes
0
answers
1k
views
ASP.NET Session State with SQL Server In-Memory OLTP and Session isolation set to snapshot
We deployed a new build on Framework v 4.7.2. We also deployed the async Asp.Net session state module and in memory OLTP provider as documented here
Our testing environment was fine, and the canary ...
0
votes
0
answers
654
views
How to create a copy of table that is in-memory optimized?
I have a table T1 that I created in-memory using the in-memory procedure in SQL Server 2016. Now, I want to create a copy of the same table T1 into another table T2 which should have the same schema i....
1
vote
2
answers
69
views
Traversing a hierarchy on Azure SQL from a natively compiled stored procedure
I have a simple self referencing in-memory table
CREATE TABLE [Accounts]
(
Id UNIQUEIDENTIFIER NOT NULL,
[ParentAccount_Id] UNIQUEIDENTIFIER NULL,
CONSTRAINT [PK_Accounts] PRIMARY KEY ...
0
votes
0
answers
233
views
Alternative to partitioning in SQL Server 2016 on memory optimized tables
I have a script in existing SQL Server 2012 to delete old/expired sessions using partitioning. Data is moved from the source table to the staging table on basis of weekday partition and truncate ...
0
votes
1
answer
338
views
native compiled stored procedure sp_getapplock alternative
tldr; what is alternative of sp_getapplock in the native compiled stored procedure.
I have a memory-optimized table and few indexes on it. it is mission critical app. I am using a memory-optimized ...
1
vote
1
answer
947
views
Faster SQL temp table and table variable by using memory optimization
Scenario C in This Microsoft Doc describes how temp tables scoped to a connection can be replaced with Memory-Optimized Tables. The scheme uses a Filter Security Policy which calls a function to ...
1
vote
0
answers
1k
views
What is the best iterating method for, say, MERGE, for a memory optimized SQL Server stored procedure?
I have to work with sets with millions of rows in my SQL Server database.
Almost all my commands use the MERGE statement. I merge here and there, this table and that table. I use stored procedures ...
1
vote
1
answer
217
views
Memory optimized data base and table variable
After looking into different groups/discussions i didn't found any satisfactory answer of my question,
I have around 1.5 TB size Sql server database in production, and there is also a transaction ...
10
votes
1
answer
4k
views
Memory Optimized Tables - Slower INSERT than SSD
I have observed that inserting data into a Memory-Optimized Table is much slower than an equivalent parallelized insert to a disk-based table on a 5-SSD stripe set.
--DDL for Memory-Optimized Table ...
0
votes
2
answers
5k
views
cross database query on sql server 2014
I have a database with a memory optimized table. I want to archive this table in another database. I want to write an stored procedure to do that.
I am implemented below sample from 1 and 2 ...
1
vote
1
answer
2k
views
When using memory optimized tables, should the database size not exceed RAM size?
In SQL Server 2016, if we create a database in RAM (i.e using memory optimized tables), the database size should not exceed RAM size, am I right in saying that?
1
vote
1
answer
1k
views
Updating Memory Optimized Table [duplicate]
I have a memory-optimized table in SQL Server 2017 called "User".
I'm going to update a row as:
using (var context = new MyDbEntities())
{
var user = context.Users.Single(p => p.UserId == 1);
...
0
votes
2
answers
1k
views
SQL Server memory optimized tables detecting concurrency violation
In SQL Server memory optimized tables, the rowversion data type is not allowed.
In my application I still want to be able to detect a concurrency violation where user A opens an item for edit, User ...
0
votes
0
answers
201
views
The function nchar is not supported with natively compiled modules
Error : The function nchar is not supported with natively compiled modules.
How I can use Nchar() Function in native Function?
my query is :
Declare @Input NVARCHAR(MAX)
DECLARE @Output NVARCHAR(MAX)...
1
vote
1
answer
962
views
Insert from memory optimized table to physical table
Imagine this scenario in SQL Server 2016: we have to tables A and B
A is a memory optimized table
B is a normal table
We join A and B, and nothing happens and 1000 rows are returned in min time.
But ...
4
votes
1
answer
825
views
Queries to in Memory table are slower than to disk based
I'm working with an already built table which I must migrate to a memory optimized one. The following is a clone from the disk based. Both have the same structure with the exception that the disk ...
0
votes
2
answers
123
views
Does Stream Analytics support output to SQL Server memory optimized table?
In the book "Mastering Azure Analytics: Architecting in the Cloud" by Zoiner Tejada I found a paragraph stating that memory optimized tables are not yet supported as output by Stream Analytics.
...
0
votes
2
answers
244
views
Best Hive SQL query for this
i have 2 table something like this. i'm running a hive query and windows function seems pretty limited in hive.
Table dept
id | name |
1 | a |
2 | b |
3 | c |
4 | d |
Table time (build with heavy ...
0
votes
1
answer
1k
views
Why is a bulk insert to a memory-optimized non-durable table the same speed as a durable table?
When running a large bulk insert to a durable and a non-durable memory optimized table, I'm getting the same speeds for both. Shouldn't the speed of of a bulk insert to a non-durable memory-optimized ...
1
vote
1
answer
1k
views
SQL Server Hekaton Reclaim Memory Used by Dropped Memory-Optimized Tables
I'm using
Microsoft SQL Server Enterprise: Core-based Licensing (64-bit) Version
12.0.4100.1
I have a code which creates many non-durable memory-optimized tables, uses them for some things, and ...
1
vote
1
answer
3k
views
Select into memory optimised table
I have a stored procedure that will convert some dynamic sql into either a temp table or view dependant on a database setting. This is used to "tune" database functionality between different clients ...
1
vote
2
answers
755
views
Memory optimized table - Partially load data into memory
Is it possible for a memory optimized table in SQL server to have part of its data in memory and the rest on disk?
I have a requirement to load the last 3 months' data into memory, and the rest
of ...
4
votes
0
answers
503
views
After Update errors on Memory optimized tables SqlServer
Using EF 6.1.3, SqlServer 2016. I have recently modified certain tables in my DB to memory optimized tables. Everything functions correctly, however, when I added an after update trigger on a non-...
0
votes
2
answers
1k
views
Unable to call into C compiler when creating memory optimized table in SQL Server 2014
I am trying to create my first memory optimized table using SQL Server 2014. I first created the necessary file group and file without issue. But when I try to create a simple table using
CREATE ...
1
vote
2
answers
429
views
Can SqlServer in-memory tables be replacement with ASP.NET cache?
Our current system was architectured like;
We have around 5 million records in a DB table. Depending on the need, we get, say a resultset of 1 million records and keep them in cache throughout the ...
3
votes
2
answers
14k
views
"There is insufficient system memory in resource pool 'default' to run this query" during execution of stored procedure
I am using a stored procedure which loops through a cursor. Within the cursor I am calling a natively compiled stored procedure. The natively compiled stored procedure does an insert into a memory-...
0
votes
1
answer
182
views
(Async) execution out of a natively compiled stored procedure
I have a natively compiled stored procedure and I would like to do an async execution of another stored procedure. The background is, that I need to store some staging data as fast as possible (in my ...