Most Popular

1500 questions
21
votes
4 answers

What's the most efficient UUID column type

For storing a 128 bits UUID there are multiple storage options: a byte[16] column two bigint/long(64 bits) columns a CHAR(36) column - 32 hex digits + 4 dashes. a UUID database specific column, if db supports it From an indexing point of view…
Vlad Mihalcea
  • 917
  • 3
  • 9
  • 23
21
votes
2 answers

Can foreign keys cause deadlocks and hinder READ COMMITTED SNAPSHOT?

This is a followup question from: https://stackoverflow.com/questions/7684477/is-it-possible-to-set-transaction-isolation-level-snapshot-automatically I'm still having deadlock/timeout situations in the ASP.NET application when running large reports…
Tim Schmelter
  • 729
  • 2
  • 9
  • 20
21
votes
4 answers

How do you find SQL Server version/edition without SSMS installed?

How do find out which edition is installed without having the management studio installed? I have a server that functions as a license manager for another software. Upon investigation of a high RAM usage alert, I found that the sqlservr.exe…
AKDiscer
  • 1,395
  • 6
  • 28
  • 40
21
votes
1 answer

How to convert a unix time to PostgreSQL' Timstamp without timezome?

I have a PostgreSQL database running on a server which has its time zone set to India's Time Zone (i.e. UTC +5:30) I have some data in a table which is created like this: CREATE TABLE "CLOUDDATA" ( "CD_Tm_Obs" timestamp without time zone, …
Devdatta Tengshe
  • 631
  • 4
  • 9
  • 16
21
votes
7 answers

Script to see running jobs in SQL Server with Job Start Time

how to write script to see running jobs in SQL Server with Job Start Time? SELECT sj.name, sja.run_requested_date, CONVERT(VARCHAR(12), sja.stop_execution_date-sja.start_execution_date, 114) Duration FROM msdb.dbo.sysjobactivity sja INNER…
zerbug
  • 329
  • 1
  • 2
  • 4
21
votes
1 answer

Weird SQL Server instance crash on casting to numeric

While working with C# Entity Framework I noticed a crash of my SQL Server instance. I was able to track it down to this statement: SELECT * FROM dbo.[TestTable] where mpnr in…
SteLoe
  • 362
  • 1
  • 9
21
votes
5 answers

Is ROLLBACK a fast operation?

Is it true that RDBMS systems are optimized for COMMIT operations? How much slower/faster are ROLLBACK operations and why?
garik
  • 6,782
  • 10
  • 44
  • 56
21
votes
5 answers

SQL Server Database Not Shrinking

I have an SQL Database with a lot of unused space. However when I run Tasks | Shrink | Database And Tasks | Shrink | Files from Management studio it isn't freeing up any space. Unfortunately the machine that it is running on is running out of hard…
DermFrench
  • 471
  • 3
  • 6
  • 15
21
votes
1 answer

Can the 'returning' clause return source columns that are not inserted?

Here's a minimal example of my real-world problem: create table t(id serial primary key, rnd double precision); of course you can return the inserted columns with a returning clause: with w as (insert into t(rnd) values(random()) returning…
Jack Douglas
  • 40,517
  • 16
  • 106
  • 178
21
votes
6 answers

How to solve UTF8 invalid byte sequence copy errors on a restore, when the source database is encoded in UTF8?

I was given the task to migrate a PostgreSQL 8.2.x database to another server. To do this I'm using the pgAdmin 1.12.2 (on Ubuntu 11.04 by the way) and using the Backup and Restore using the custom/compress format (.backup) and UTF8 encoding. The…
pedrosanta
  • 3,463
  • 3
  • 17
  • 7
21
votes
2 answers

What is blocking and how does it happen?

I tried to find some information about blocking in SQL Server, but I could not find a concise explanation for what it is and how it happens. Could you please enlighten me?
jrara
  • 5,393
  • 20
  • 58
  • 65
21
votes
4 answers

What does "index" mean on RDBMSs?

I use indexes like most developpers do (mostly on... well ! index), but i'm sure there is a lot of subtle way to optimize a database using index. I'm not sure if it is specific to any implementation of a DBMS. My question is : what are good examples…
Thomas Joulin
  • 321
  • 3
  • 6
21
votes
3 answers

What max_allowed_packet is big enough, and why do I need to change it?

I have MySQL (5.5) in master-slave setup and created another slave server. I stopped the original slave, dumped the data, copied and reimported and it worked fine. I noted the master_log pos of the original slave and used these commands to set it on…
CodeMonkey
  • 481
  • 1
  • 4
  • 9
21
votes
2 answers

Connection pools being reset with Error: 18056, Severity: 20, State: 46. & Perfmon Counters not showing

We are using SQL Authentication (to reduce the number of connection pools) & .NET 4.0 connection strings to connect to SQL Server Enterprise Edition 2012 SP1 on a Windows 2008 R2 Enterprise Server: Microsoft SQL Server 2012 (SP1) - 11.0.3000.0…
DamagedGoods
  • 2,591
  • 6
  • 34
  • 48
21
votes
1 answer

Performance difference between MySQL and PostgreSQL for the same schema/queries

I'm a newbie DBA, and I have experience in Microsoft SQL Server but I want to jump to FLOSS. I'm starting a company, and we develop an app (PHP) with a Postgres backend, and we did some tests comparing with MySQL too. We observe that MySQL is twice…
Javier Valencia
  • 313
  • 1
  • 3
  • 7