All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
470 views

How to Design Name and Address with Multiple Addresses

I have a names and addresses table: Name Address AddressType ID CustID Sample: Bob Smith, 123 Main St, Corporate, 1, 1 Bob Smith, 123 Main St, Home, 2, 1 null, P.O. Box 123, Warehouse, 3, 1 ...
12 votes
4 answers
7k views

How do I get SSMS to use the relative path of the current script with :r in sqlcmd mode like SSDT does?

If I have foo.sql and bar.sql in the same folder, foo.sql can reference bar.sql when run from SSDT in sqlcmd mode with :r ".\bar.sql". However, SSMS won't find it. Procmon shows SSMS is looking in %...
1 vote
2 answers
35 views

Performance issues of a queue implemented on top of InnoDB

Brief problem statement There will be a detailed explanation below, but this initial problem statement is just to give you a feel of what we’re dealing with here. We have a feature called “Tasks”, ...
0 votes
3 answers
35 views

What index can be created to optimise this query?

I've got the below SQL query that runs extremely slowly. As for this query, this is due to the "ORDER BY" statement, since Postgres is scanning the changes table by "counter" which ...
1 vote
1 answer
2k views

Postgres constraints: EXCLUDE (name WITH =) vs partial unique index

I am refactoring my database constraint for such a table: CREATE TABLE products ( name text NOT NULL, status text NOT NULL ); A former engineer working on the project had such a constraint: ALTER ...
0 votes
1 answer
366 views

Wordpress site has a lot of connections

Recently my wordpress site is having troubles and is stopping from working due to heavy load in the mysql processes. I need to know what is causing all this traffic and how to narrow the issue so I ...
-1 votes
0 answers
15 views

SQL Bulk Insert Saves extra character

i use this code for Bulk Insert BULK INSERT [Table] FROM 'D:\phones.txt' WITH ( ROWTERMINATOR = '0x0a' ) My data has only one column of 10 characters For example | 1234567890 | | 1234567891 | ...
0 votes
1 answer
615 views

How to reload repmgr configuration changes?

I use repmgr to provide failover to my PostgreSQL cluster. If I change a server-specific parameter in the repmgr.conf file for one of my standbys, how do I get repmgr to recognize the changed value? ...
0 votes
0 answers
4 views

I'm having trouble copying database users from one Azure SQL Server to another. The EXECUTE permission was denied

I'm trying to use the instructions here - https://learn.microsoft.com/en-US/troubleshoot/sql/database-engine/security/transfer-logins-passwords-between-instances to copy logins between the server ...
0 votes
1 answer
457 views

Can I run commands from aws_s3 extensions as non-root on PostgreSQL?

I'm trying to copy data from S3 to PostgreSQL (Amazon AWS RDS). I've set up the following: CREATE EXTENSION aws_s3 cascade schema reporting; CREATE DATABASE my_database; \connect my_database; -- ...
1 vote
1 answer
18 views

Does a serializable transaction around a single statement have any effect compared to an implicit transaction?

I'm doing some performance auditing of our codebase and have noticed that we always run SQL statements within a serializable transaction. I've also noticed that many of these transactions only perform ...
0 votes
1 answer
1k views

Master slave replication with different mysql version is on both slave and master

Currently, we have MySQL master-slave replication. Both master and slave servers have Mysql 5.5 Currently I need to add one more Master server having version 5.7. Is it possible to add Multiple ...
0 votes
1 answer
19 views

snapshot to apply just the schema changes - not the data

I am restoring databases to each side of my transactional and merge replications. Basically the publication and the subscriber are the same database initially. I still need to run the snapshot agent ...
0 votes
1 answer
13 views

Postgresql: could not determine polymorphic type because input has type unknown

The following query works: select t.oid, t.typname, case t.typcategory when 'C' then json_object('{}') when 'E' then (SELECT array_to_json(array_agg(enumlabel::text)) FROM pg_enum WHERE ...
1 vote
2 answers
94 views

Why does SQL Server require a LEFT JOIN to retrieve a status that doesn't exist?

I was recently querying our internal database inventory tool for a list of servers, instances and databases, and was adding the corresponding status to each server, instance and database. Relationship ...
2 votes
1 answer
3k views

Postgresql: Partition table by hour

I have a system that inserts several million records over the course of 24 hours. Users don't care about the data that's older than 24 hours, and typically query data over a small time frame (5 to 60 ...
1 vote
1 answer
2k views

DB Design - Assigning users to multiple sites with different roles

I am working on a DB design that lets me manage roles and permissions for each user per site. These are my business rules: A user can manage multiple sites A user can only have one role per site A ...
8 votes
2 answers
22k views

Fixing corrupted Firebird database

I have a 200 GB Firebird database (created with Firebird 2.1.3, currently running 2.1.5), and it appears to be corrupted. When I try to do a backup I get: database file appears corrupt <> ...
0 votes
3 answers
1k views

Does database systems use basic system calls of local file system?

Suppose database system inserts a row in table, will it use write() system call of host file system to write that particular row to table?
9 votes
3 answers
3k views

Creating an index in both asc and desc directions

Over the past few weeks I've been raging against an old Firebird database. This database is crappy for all sorts of reasons, but one thing I noticed was that every single field of every single table ...
0 votes
0 answers
21 views

How to create and manage superusers (like sysadmin) in Google Cloud SQL with SQL Server

I'm a database engineer that works most with SQL Server and with experience with SQL Server and all SQL alternatives in Microsoft Azure and AWS. Recently I had to work with a managed SQL Server ...
1 vote
1 answer
656 views

Long TRUNCATE operations

On Microsoft SQL Server 2019, there is a lot of long temp tables TRUNCATE operations with time over 5..10 seconds. Easy query like "TRUNCATE TABLE #tt22" can take over 15 seconds. It's an ...
2 votes
1 answer
5k views

How to trace a query on Firebird?

With SQL Server we can trace for a period of time, to get what queries are running. How can I do this with Firebird? I'm reading something on their website but there's only user trace like if the ...
8 votes
1 answer
10k views

Firebird monitoring tables

I am working with a Firebird 2.1.1 database and I started reading about the Monitoring tables. I am trying to see somehow in real-time what queries does each client performs in the database. I had ...
1 vote
1 answer
152 views

Is it safe to rely on transactions in Firebird 2.5 Embedded DB in case of power outage?

How it's safe to say that the following list of action will never be reflected in DB in case of power outage somewhere in the middle of #2 line, before transaction is committed? #1 begin transaction #...
0 votes
2 answers
137 views

Grid 19c: Purpose of QUORUM FAILGROUP on shared NFS mountpoint when you already have an +OCRDG diskgroup

I'm working somewhere now where every ASM diskgroup has been made with an extra disk under the QUORUM FAILGROUP option, and is built with the following pattern: CREATE DISKGROUP stuffdg NORMAL ...
1 vote
1 answer
468 views

MariaDB uses "wrong"/irrelevant Keys on large table

We have migrated our database from a local hosting company to AWS. Now when we run a particular query on AWS it finishes in about a minute (processlist says "sending data") where on the old server the ...
1 vote
1 answer
13 views

Can I create a read replica of my primary Azure SQL Server database on a different server with a different name?

I have a database named myAppDB on an Azure hosted SQL Server in the Eastern US Datacenter. I created a new SQL Server in the South Central US datacenter. I then Created a Geo Replica of myAppDB on ...
0 votes
2 answers
71 views

What database should I use for storing all Reddit comments/submissions for local hobby project

I'm playing around with machine learning projects that use Reddit comments. I would like to download all Reddit comments and submissions (available as a torrent) and store them in a database on an ...
0 votes
0 answers
18 views

Unable to login to MariaDB, as root@localhost, with non root linux user

I have a MariaDB 10.3.13 server installed on Red Hat linux. I can only login to mysql, as root@localhost, through root linux user. Login to mysql server through non root linux user. It fails [dave@...
0 votes
1 answer
425 views

PG Admin Sessions

I have a frontend written in MS Access that connects to a Postgres backend through ODBC. Sometimes the number of sessions reaches 100 and at that point I get an "ODBC call failed" error. I ...
1 vote
2 answers
275 views

Advice: Should i use multiple physical databases or one physical database and several logical ones

We are creating a web application that will be used by companies as their business application every day, each company will have many employees and a lot of data. Is it wise for each company to have ...
-1 votes
2 answers
26 views

LEFT JOIN LATERAL with a function result, how to prevent unnecessary function calls?

I have a costly function and it only provides relevant data when certain conditions are met. That data is inserted into the result through a LEFT JOIN LATERAL as shown below. As it works now, the ...
4 votes
2 answers
2k views

Column length error querying SQLite via SQL Server Linked Server

I am attempting to query SQLite to copy data into corresponding tables in SQL Server. This is the first stage of an ETL process I'm putting together. Windows 10 Pro, SQL Server 2017 Developer Edition,...
-1 votes
0 answers
15 views

postgreeSQL performance estimation w.r.t reads and writes per second

Here are all the parameters involved:- instance (aws rds db.t3.micro):- vcpu:2,memory:1GiB, 1 core Image :-PostgreeSQL 15 Tables:- TableA:-(aid (PK),a1(FK to B.bid),a2,..a7) TableB:-(bid (PK),b1(...
0 votes
1 answer
276 views

Backup Functions in PgAdmin 4 Version 1.6

How to backup all functions in pgadmin 4 version 1.6? After executing the below query the backup functions stored in which place? And how to find it? How to know all information is backed up with ...
-1 votes
1 answer
13 views

Cassandra 3.11.10 sstable utilities are missing in /bin directory of my cassandra database

We have our Cassandra cluster running on 3.11.10 as you can see from the below nodetool version ReleaseVersion: 3.11.10 Cassandra is installed on Linux OS of version '7' as you can see from the below ...
0 votes
0 answers
4 views

PolarDB disk expansion pre-expansion report space issues

The disk for the PolarDB instance has been expanded to 1.34TB, resulting in a usage rate reduction to 48.56%. However, issues with report space persist both before and after the expansion. How can ...
0 votes
0 answers
8 views

AWS RDS `show binary logs` consume too much CPU [closed]

We have Mysql Aurora RDS and we have a few DMS. SHOW BINARY LOGS consume like 9 CPU, how can i reduce this ? Can i optimize the Database? Is normal to have so big CPU ?
0 votes
1 answer
455 views

How do MySQL-Workbench and mysqldump return dumps with vastly different file-sizes?

I observed that the dump of my DB done "by hand" in the CLI is a lot bigger (>800MB) than the one produced by the Workbench (v8.0) (<500MB) and I am trying to figure out why that's the ...
0 votes
1 answer
11 views

MariaDB 10.6 Slow replication - Relay log replay possibly?

I have one master and two slaves (will become one slave when this is resolved) The master is on a dedicated server that is very fast. The Old slave server that is in sync is on a busy shared server ...
1 vote
1 answer
492 views

How to fix table with corrupt rows

I was inserting records into a table, when I suddenly got disconnected from the DB server When I tried doing a row count on the table, I got a fatal error 824 I tried DBCC CHECKTABLE and it indicated ...
0 votes
0 answers
5 views

Write-DbaDbTableData - "Exception occurred while trying to enumerate the collection" error

I have the following code that I use to retrieve some TempDB space details on an AG: $DataDriveTable = Invoke-DbaQuery -SqlInstance $SQLInstance -Database TempDB -Query $SelectDriveQuery -...
0 votes
1 answer
44 views

Postgres doesn't use functional index for LIKE queries

I have a query with a LIKE operator: SELECT "task_v1_taskv1"."id", "serviced_object_v1_servicedobjectv1"."id" FROM "task_v1_taskv1" ...
1 vote
1 answer
564 views

MySQL Partitioning based on addition

I cannot find a good keyword to search for this kind of question, so here you go: Suppose i have this table: CREATE TABLE test ( tr_uuid BINARY(16) NOT NULL, Customer VARCHAR(10) NOT NULL, Data ...
9 votes
1 answer
2k views

AWS RDS postrgres massive disk use, small tables

I can't figure out why our AWS postgres server has consumed all of it's space. We just had to up the storage space allocated to it, but can't find any hint from postgres that it's using that much ...
0 votes
1 answer
565 views

what could make examined_rows change radically?

I have a mysql-based application which sometimes takes forever to execute a select statement. When this happens, the statement appears naturally in my slow query log: # Query_time: 51.826420 ...
0 votes
1 answer
346 views

perform non locking select when updating another table

We need to perform the following (periodic) query in mariadb: update A set status='INACTIVE' where status='ACTIVE' and a.b_id in (select id from B where ... LOCK IN SHARE MODE); Unfortunately it ...
4 votes
3 answers
433 views

failed pt-online-schema-change left behind triggers. How to delete?

We had a failed pt-osc - the server ran out of disk space. And now the triggers are left behind SHOW TRIGGERS; pt_osc_xxx_production_orders_ins pt_osc_xxx_production_orders_upd ...
0 votes
2 answers
829 views

If I need to restrict access to certain databases?

So I've just created a MySQL server. I also created some users only having specific access to certain databases, but do I need to restrict access to default databases to the users I've created? If so, ...

15 30 50 per page
1
2 3 4 5
2065