Database Administrators Stack Exchange Community Digest

Top new questions this week:

What's the use case of disabling an index?

I just learned that indexes can be disabled on a table. Even the clustered index can be disabled. After that, users can't access the index or the data if clustered index. When will we disable an index?...

sql-server index  
user avatar asked by Fajela Tajkiya Score of 9
user avatar answered by AMtwo Score of 12

Does killing an application kill the SQL connection?

Suppose an application has established two connections to SQL Server. A session is actively running a query A session that is sleeping, waiting for the next instruction Does killing this application ...

sql-server sql-server-2019  
user avatar asked by variable Score of 9
user avatar answered by Josh Darnell Score of 22

Select telemetry data based on relational data in PostgreSQL/TimescaleDB

I'm trying to solve a particularly difficult problem. I am storing some telemetry data from some sensors in an SQL table (PostgreSQL) and I want to know how I can I write a query that will group the ...

postgresql join query aggregate timescaledb  
user avatar asked by kk_p Score of 5
user avatar answered by kk_p Score of 3

How does SQL Server update lock work?

I'm learning SQL Server and trying to understand how SQL Server updates a row. As I understand, first SQL Server puts an intent exclusive lock on the database, then an intent exclusive lock on the ...

sql-server update locking blocking  
user avatar asked by Fajela Tajkiya Score of 5
user avatar answered by Paul White Score of 10

Index Design: clustered index using a DATE

Every once in a while, one needs a check. This is such a time. I have tables that are used for reporting. They are deleted/inserted once a day or multiple times a day to "refresh the data" ...

sql-server index azure-sql-database index-tuning clustered-index  
user avatar asked by tbasallo Score of 5
user avatar answered by J.D. Score of 5

Find a previous statement or held locks in a blocking situation

I'm using XE blocked_process_report to detect and analyse the blocking. But since it's a point-in-time situation, I only see the blocking leader's statement currently being run and the incompatible ...

sql-server sql-server-2019 monitoring blocking  
user avatar asked by Zikato Score of 5

Change Column Data Type from numeric(18, 2) to numeric(22, 6) on a BIG Table

We have a very big POSTGRES table containing more than 8 BILLION rows and growing at a very high rate (30 million rows per day). Our Table is Partitioned on date. Each partition contains 6 months data ...

postgresql postgresql-performance datatypes alter-table  
user avatar asked by Mohd Waseem Score of 4
user avatar answered by dezso Score of 8

Greatest hits from previous weeks:

Create a MySQL database with charset UTF-8

I'm new to MySQL and I would like to know: How can I create a database with charset utf-8 like I did in navicat? create mydatabase; ...seems to be using some kind of default charset.

mysql collation utf-8  
user avatar asked by user3397998 Score of 205
user avatar answered by shellbye Score of 359

Writing select result to a csv file

We need to write the SELECT query results to a csv file. How can it be done using T-SQL in SQL Server 2008 r2? I know that it can be done in SSIS, but for some reasons, we don't have this option. I ...

sql-server-2008 t-sql  
user avatar asked by Sky Score of 48
user avatar answered by RK Kuppala Score of 59

Good explanation of cascade (ON DELETE/UPDATE) behavior

I don't design schemas everyday, but when I do, I try to setup cascade updates/deletes correctly to make administration easier. I understand how cascades work, but I can never remember which table is ...

mysql foreign-key  
user avatar asked by Johntron Score of 149
user avatar answered by ypercubeᵀᴹ Score of 204

"Could not find stored procedure' even though the stored procedure have been created in MS SQL Server Management Studio

I have created a table testtable inside the database testbase that have the following structure: product_no (int, not null) product_name (varchar(30), not null) price (money, null) expire_date (date, ...

sql-server-2008 stored-procedures ssms  
user avatar asked by Jack Score of 24
user avatar answered by Jack Score of 5

How to update a table from a another table

I have one table A has column (id, field_1,field_2), and another table B has column (id,field_2) Now I want to merge table B to A, that means i want to update field_2 in table A to value of table B. ...

user avatar asked by zjffdu Score of 28
user avatar answered by a_horse_with_no_name Score of 30

How to show the column names of a table?

The case is simple: You have a MySQL database where you have only an SQL query interface and you want to know the database structure with queries. You can list tables with show tables; command, but ...

user avatar asked by mico Score of 19
user avatar answered by mico Score of 7

How do I insert a row which contains a foreign key?

Using PostgreSQL v9.1. I have the following tables: CREATE TABLE foo ( id BIGSERIAL NOT NULL UNIQUE PRIMARY KEY, type VARCHAR(60) NOT NULL UNIQUE ); CREATE TABLE bar ( id BIGSERIAL ...

postgresql foreign-key postgresql-9.1 insert  
user avatar asked by Stéphane Score of 87
user avatar answered by ypercubeᵀᴹ Score of 104

Can you answer these questions?

Query to Extract all Values below Certain Amount ignores 0-values

Trying to write a query in SqlServer Dev 2017 with SSMS with Object Explorer. I'm trying to extract all members ( PK) with totals ( Sum(ColumnValues)), below a certain amount. My code extracts all ...

sql-server-2008 query  
user avatar asked by MSIS Score of 1

Can a redundant index improve SELECT performance?

Is it possible that adding a redundant index improves the performance of a query? I encountered a case like that several days ago and since then I've been scratching my head: how? The MariaDB 10.4 ...

index mariadb index-tuning performance-tuning  
user avatar asked by jacek.ciach Score of 2
user avatar answered by ypercubeᵀᴹ Score of 0

Table Consistency Errors

We have encountered database corruption / consistancy issue in one of our database tables, which I'd like to run past the community. Disclaimer: This is a MSSQL database we (the DBA team) have ...

sql-server corruption consistency  
user avatar asked by Tom Score of 2
user avatar answered by Tom Score of 0
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