Most Popular
1500 questions
23
votes
1 answer
Implementation and contraindications for OPTIMIZE_FOR_SEQUENTIAL_KEY
SQL Server 2019 CTP3.1 introduced an optimization to address last-page insert contention. This takes the form of an index option called OPTIMIZE_FOR_SEQUENTIAL_KEY.
One imagines this could be an adaptation of Bw-Tree or Bz-Tree. However, these rely…
Michael Green
- 24,839
- 13
- 51
- 96
23
votes
2 answers
SQL Server: Should we use TCP or Named Pipes or use the default?
When connecting to a SQL Server 2008 R2 from a .NET 4 client application on a different server in the same LAN, one can set three different network protocols:
TCP
Named Pipes
Don't set anything in the connection string and use the default
What is…
usr
- 7,330
- 5
- 32
- 58
23
votes
2 answers
Windows OS Quantum vs. SQL OS Quantum
Simple Question
How is the SQL Server Quantum (4 ms) synchronised with the Server OS Quantum (normally: 187.5 ms)?
Simple Question Explained
After 184 ms of OS quantum being used (which corresponds to 46 full SQL quantums) the OS quantum has 3.5 ms…
John K. N.
- 17,649
- 12
- 51
- 110
23
votes
4 answers
Test MySQL credentials from Linux command line?
How do you test MySQL credentials from the command line on a Linux server?
Jake Wilson
- 2,427
- 8
- 22
- 23
23
votes
2 answers
When does SQL Server warn about an Excessive Memory Grant?
What are the conditions that produce an "Excessive Grant" execution plan warning?
The query memory grant detected "ExcessiveGrant", which may impact the reliability. Grant size: Initial 5128 KB, Final 5128 KB, Used 16 KB.
SSMS
Plan Explorer
…
Paul White
- 83,961
- 28
- 402
- 634
23
votes
2 answers
What can cause a mirroring session to timeout then failover?
We have two production SQL Servers running SQL Server 2005 SP4 with cumulative update 3. Both servers run on physical machines that are identical. DELL PowerEdge R815 with 4 x 12 core CPUs and 512GB (yes GB) of ram, with 10GB iSCSI SAN connected…
Hannah Vernon
- 70,041
- 22
- 171
- 315
23
votes
2 answers
SQL Server does not optimize parallel merge join on two equivalently partitioned tables
Apologies in advance for the very detailed question. I have included queries to generate a full data set for reproducing the problem, and I am running SQL Server 2012 on a 32-core machine. However, I do not think this is specific to SQL Server…
Geoff Patterson
- 8,397
- 2
- 27
- 53
23
votes
5 answers
Is it still best practice to avoid using the default ports for SQL Server?
Historically, it has been recommended not to use the default ports for connections to SQL Server, as part of security best practice. On a server with a single, default instance, the following ports would be used by default:
SQL Server service -…
user3399498
- 575
- 2
- 5
- 16
23
votes
3 answers
Concurrent transactions result in race condition with unique constraint on insert
I have a web service (http api) which allows a user to restfully create a resource. After authentication and validation I pass off the data to a Postgres function and allow it to check authorisation and create the records in the database.
I found a…
Elliot Blackburn
- 335
- 1
- 2
- 7
23
votes
5 answers
Can SQL Server's crash resilience be improved?
We have PCs running SQL Server (2008 SP4 and 2016 SP1) which regularly lose power. Obviously, this sometimes leads to (index) corruption of the SQL Server database, which we need to restore afterwards.
I am aware that SQL Server is not designed for…
Heinzi
- 3,145
- 2
- 29
- 42
23
votes
6 answers
MySQL FOREIGN KEY constraint is incorrectly formed
I have the following table definition:
CREATE TABLE `async_task` (
`idasync_task` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`idasync_type` int(10) unsigned NOT NULL,
`priority` tinyint(3) NOT NULL,
`status` enum('todo','doing','failed')…
Daniel Gray
- 669
- 3
- 9
- 16
23
votes
6 answers
MySQL: Return JSON from a standard SQL Query
I have read about JSON objects and the JSON object type. I only want to do a select and it return JSON. I do not necessarily want to store a JSON object. Serialization per se it not my question. The columns are regular Varchar, Int, etc.…
johnny
- 592
- 3
- 8
- 17
23
votes
1 answer
How to connect to an remote PostgreSQL database on Ubuntu using pgAdmin3?
I'm trying to setup a PostgreSQL database on an Ubuntu machine. I would like to be able to access it using pgAdmin3 from a remote machine. How do I setup this?
I have installed the PostgreSQL database on Ubuntu using:
sudo apt-get install…
Jonas
- 32,975
- 27
- 61
- 64
23
votes
2 answers
Performance difference between Clustered and Non Clustered Index
I was reading Clustered and Non Clustered Indexes.
Clustered Index - It contains Data Pages. That means the complete row
information will be present in the Clustered Index Column.
Non Clustered Index - It only contains the Row Locator information in…
Pankaj Garg
23
votes
2 answers
How to make DISTINCT ON faster in PostgreSQL?
I have a table station_logs in a PostgreSQL 9.6 database:
Column | Type |
---------------+-----------------------------+
id | bigint | bigserial
station_id | integer …
Kokizzu
- 1,363
- 6
- 17
- 34