Database Administrators Stack Exchange Community Digest

Top new questions this week:

Minimise duration of table lock

I've got a SQL table that needs to be updated daily. There may or may not be queries against that table while the update is happening. It's around 500,000 rows. We have an issue where there is locking ...

sql-server locking merge  
asked by the Ben B Score of 5
answered by J.D. Score of 7

Are enums still evil (in MySQL 8.0)?

So I have a disagreement with a coworker about using enums vs lookup tables. This very old article from 2011 and MyQL5.5 still gets referenced again and again by those not liking enums. But we are ...

mysql mysql-8.0 enum  
asked by Florent Poujol Score of 4
answered by Bill Karwin Score of 3

How to recover from a SQL server log file drive crash?

Assuming data files are on D: and Log files are on E: Say the E drive crashes and the log files (.ldf) are lost. I attach a new empty disk to the E: and start the sql server. Upon startup, SQL Server ...

sql-server transaction-log sql-server-2019 datafile  
asked by variable Score of 4
answered by Tibor Karaszi Score of 8

Always On Availability Groups connection with secondary database established for primary database

I'm seeing this messages almost everyday in one of the production server. I don't feel comfortable seeing there anything we can do to suppress this messages ? though it's showing No user ...

sql-server sql-server-2016 availability-groups  
asked by Kiran Narlapati Score of 3

Inconsistent data when combining (LEFT) JOIN with SELECT FOR UPDATE

I have recently stumbled upon a seemingly odd behavior of SELECT ... FOR UPDATE when combined with (LEFT) JOIN. Here is the table structure as well as a scenario to reproduce the result: Table ...

postgresql locking concurrency isolation-level  
asked by auxdevelopment Score of 3
answered by Erwin Brandstetter Score of 1

How to get the specific queries that are contributing to high lock wait times?

I am looking at SQL lock wait time perf mon counter and it is indicating high value ranging from 5 to 20 seconds during certain times of the day. I have setup extended events which gives me the T-SQL ...

sql-server locking sql-server-2019  
asked by variable Score of 2

Postgresql 14 Performance regression versus PG13

I migrated a database from Postgresql 13 to Postgresql 14 recently, and I saw a x2 execution time in a specific case which I can't understand. The issue has been seen on a Postgres on Linux, and I ...

postgresql postgresql-performance postgresql-13 postgresql-14  
asked by whisust Score of 2

Greatest hits from previous weeks:

IntelliSense not working but it is enabled

This problem is really proving to be a tricky one (and quite annoying). In SQL Server Management Studio 2008, up until a few days ago my IntelliSense was working great. Then all of a sudden it ...

sql-server sql-server-2008 intellisense  
asked by Thomas Stringer Score of 33
answered by Ezi Score of 11

Case with multiple conditions

I need to change returned value, from select statement, based on several conditions. I tried something like that: ,CASE i.DocValue WHEN 'F2' AND c.CondCode IN ('ZPR0','ZT10','Z305') THEN c.CondVal ...

asked by Muflix Score of 24
answered by Mark Sinkinson Score of 38

Mongodump: Unrecognized field 'snapshot'

I am using mongodump from mongo tools to download a backup of my server. However as I run the command, the command returns "Unrecognized field 'snapshot'". The full error is: Failed: error reading ...

mongodb mongodump  
asked by Dave Score of 80
answered by Marcell Score of 134

Optimizing queries on a range of timestamps (two columns)

I use PostgreSQL 9.1 on Ubuntu 12.04. I need to select records inside a range of time: my table time_limits has two timestamp fields and one integer property. There are additional columns in my ...

postgresql index optimization postgresql-9.1 explain  
asked by Stephane Rolland Score of 139

How does ORDER BY FIELD() in MySQL work internally

I understand how ORDER BY clause works and how the FIELD() function works. What i want to understand is how the both of them work together to sort. How are the rows retrieved and how is the sort ...

mysql order-by fields  
asked by itz_nsn Score of 57

Write differences between varchar and nvarchar

Currently in our SQL Server 2012 database, we're using varchar, and we'd like to change that nvarchar. I've generated a script to do that. My question is are there any differences in how SQL Server ...

sql-server varchar  
asked by Chris L Score of 65
answered by Aaron Bertrand Score of 51

How to use sqlplus to connect to an Oracle Database located on another host without modifying my own tnsnames.ora

I want to connect to an oracle database located on another host using sqlplus. This page suggested adding an item on my tnsnames to conenct to that database local_SID = (DESCRIPTION = (ADDRESS =...

oracle sqlplus  
asked by Louis Rhys Score of 94
answered by René Nyffenegger Score of 98

Can you answer these questions?

Rotate passwords with zero down time

Big question: How to rotate passwords in an Oracle database in a zero downtime (ZDT) way? My current thought is to rotate the users. Originally, I had MY_USER that had all the tables and such. Now, ...

oracle oracle-19c  
asked by Dave Score of 2
answered by Andrew Sayer Score of 0

How to query dates in different timezones?

I have a table and index in a PostgreSQL 10.18 database: CREATE TABLE some_table ( expires_at timestamptz ); CREATE INDEX ON some_table(expires_at); Is there a way to write this query in a way to ...

postgresql index datetime timezone  
asked by ffox003 Score of 1
answered by Erwin Brandstetter Score of 0

Replication between master and slave is running, but still there is a one row difference in a few tables when checked with pt-table-checksum

This is the master status mysql> show master status; +------------------+-----------+--------------+------------------+-------------------+ | File | Position | Binlog_Do_DB | ...

mysql pt-table-checksum  
asked by skiddaa Score of 1
You're receiving this message because you subscribed to the Database Administrators community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038