All Questions
103,054
questions
0
votes
0
answers
11
views
SSRS scale-out deployment, adding third AG replica
We have two SQL Server 2019 Enterprise instances each running on Windows Server 2022 Standard (let’s call them DB01 and DB02). We have two SSRS servers (RS01 and RS02) each running SSRS 2019. They’re ...
0
votes
1
answer
26
views
Table of 4 columns "definition is too large"
I'm trying to optimize a large(4M rows) and busy table of mine. It's currently
CREATE TABLE `person_search` (
`token` CHAR(63), -- each word of the person's name
`person_id` BIGINT(20) ...
0
votes
0
answers
19
views
What are the possible ways to Monitor the state of Log Reader agent job?
Monitoring of Log reader agent job in a way that whenever it is not running/executing it would triggers an alert, or is there any way of registering the state of log reader agent job as an event in ...
0
votes
0
answers
11
views
cassandra stress test results showing dropped performance in C* version 4.1.3 compare to 4.0.5
we are planning to upgrade our cassandra cluster running on version 4.0.5 to 4.1.3.
Before upgrade, we performed stress-test on both version.
steps we followed :-
created 3 node cassandra cluster ...
2
votes
2
answers
56
views
When an index is created from a function on a column, we get the function name instead of the column name in pg_attribute in Postgres. How to fix it?
I have come up with the following query to get the table name, index_type, operator_classes, and uniqueness of indexes based on the answers mostly from @Erwin Brandstetter:
SELECT i.indrelid::regclass:...
0
votes
0
answers
13
views
MongoDB movePrimary doesn't work when the primary shard is down
We have a sharded cluster with several collections sharded. There are two collections that cannot be sharded because there is a unique index on the collection. So these two collections are on the ...
0
votes
0
answers
51
views
Why I can not execute RegisterRext to config R on the SQL Server
I am try to use R on SQL Server 2022. I try execute the steps described on the Microsoft Manuell.
I did everything what is described on the manuell, but I can not do the step: Configure R runtime with ...
0
votes
0
answers
10
views
Oracle GoldenGate SqlExec Error
I've recently intertied some Legacy code and was provide no documentation. I'm trying to understand where the issue is.
Problem
My Golden Gate replicats abend atleast once a week while trying to load ...
1
vote
0
answers
38
views
HADR_LOGPROGRESS_SYNC Wait Type on SELECT Queries
Very recently we started to notice a new wait type (HADR_LOGPROGRESS_SYNC) pop up in our environment and cause very brief (< 60 seconds) "outages"/issues noticeable to users.
Here is what ...
1
vote
0
answers
65
views
SQL Server allows select on exclusive locked table
Microsoft SQL Server 2019 CU 15.
In the first session I execute the following statements:
begin transaction
update Ledger set AmountDebit = 1000 where AccountId = 14
which creates exclusive lock on a ...
0
votes
0
answers
34
views
Does adding a new data file (without partitioning) have any pro/con compared to increasing space on existing data file?
I have a database data file with 1 data file in the default filegroup. It is reaching to 500GB in size and I'm trying to learn about whether to increase the size of existing data file or add a new ...
0
votes
0
answers
26
views
Statistics update - worthwhile on a high activity table or not?
I have a table with 1.5 billion records which is sampled at 1%. Said table receives over 200-300k insert/update/deletes per hour. Within a couple of hours, the statistics are auto updated as it ...
0
votes
0
answers
17
views
How does pg_restore detect missing depending entities?
A database origin was dumped in postgres "custom" format using: pg_dump -d origin --data-only -Fc > file.dump.
The dump was then used to restore all data in a different database with the ...
0
votes
1
answer
20
views
Implementing an automatic failback in SQL Server 2019 Availability Group
I am looking at how best to implement an automatic failback in one of our AGs. Can anyone advise please, on how best to go about this? My thoughts are as follows:
a failover has happened for whatever ...
0
votes
1
answer
70
views
Why is this PostgreSQL query with LIMIT so slow?
I have a .NET WebApi with two entities (please forgive the silly names, it's just an example):
public class Father
{
public int Id { get; set; }
public string Name { get; set; } = null!;
...
0
votes
1
answer
43
views
+50
Create an affiliate system (also known as a referral program like Rewardful, Tapfiliate) in SQLite?
I want to create a simple affiliate system that pays affiliates who refer a customer a commission of $100.
I currently have the following tables generated via an ORM.
CREATE TABLE `session` (
`id` ...
1
vote
1
answer
35
views
Excessive Execution Time
Context:
I have written a t-sql query that works perfectly if I do not use a SELECT with a combining of 2 columns (txtSubID and txtSubmitByInitials). The problem is, I need to combine the 2 columns to ...
0
votes
1
answer
41
views
What is the SQL Server behaviour if an AG node is restored from a VM snapshot?
I'm looking at 2 node synchronous AG hosted on Azure VMs. SQL server version is 2022 enterprise edition. There is file share witness as well.
Each VM has a VM level nightly backup configured so that ...
0
votes
0
answers
13
views
Implementing Surrogate Keys in Fact Tables
Can I just clarify a point: Primaries are still necessary to implement a Dimensional Model? As in, the duality of Surrogates and Primaries is incontrovertible?
The context is I am researching ...
0
votes
1
answer
35
views
What is the best way in Postgres to inherit values from parent row recursively if not provided?
Is there a pattern in SQL where a child row inherits empty (null?) values from a parent?
E.g., given the following 'chickens' table (sorry):
id
parent_id
name
flys
noise
weight
egg_color
...
0
votes
0
answers
39
views
Automatically create full backups every 7 days
I have a postgresql database configured with pgbackrest for backups. It retains full backups for 7 days:
[global]
repo1-retention-full-type=time
repo1-retention-full=7
I've set up cron to create a ...
0
votes
0
answers
16
views
Error after failing over always encrypted database
I started capturing the following error after performing failover into secondary replica for the database which was using the always encrypted feature of SQL Server 2017 Enterprise Edition:
Some ...
0
votes
0
answers
9
views
GCP Point in time recovery log storage to buckets
GCP now offers storing binary logs in Cloud Storage instead of on your MySQL disk, but for older instances, you need to disable and re-enable binary logs to start storing them in Cloud Storage.
My DB ...
0
votes
0
answers
6
views
KILL QUERY Flooding in General Query log for MySQL 8.0.25
Problem : We have two MySQL servers in master master replication. We can see many KILL QUERY statements in MySQL general log specific to stored procedures as below :
2024-03-20T21:54:45.056981+05:30 ...
0
votes
0
answers
15
views
SQL Server: Linked Server connections: Scripting
I was looking for a way to script existing linked server connections for reference and migration to other servers. I have over 150 of them pointing to Azure SQL Databases used to gather reports. After ...
4
votes
1
answer
90
views
How can I delete extended event files from within Managed Instance?
Simplifying a few details, I have a recurring process on SQL Server 2019 which runs every 10 minutes and does the following:
Reads data from extended event file targets using sys....
1
vote
1
answer
49
views
Postgres BRIN index for time-series table
I have multiple time-series tables with Pkey on timestamp column.
I'd like to test performance improvement if I change the index to be BRIN instead of BTREE.
Yet, I'd also like to have a UNIQUE ...
0
votes
2
answers
49
views
MS SQL Differential Backup: how to locate full backup source
This morning I have perform a differential backup of my database, named "MW".
Now I need to restore the backup (full+differential) on another database, named "bak_MW".
I got an ...
0
votes
1
answer
42
views
How to check data type in mysql?
In PL/pgsql,pg_type() give use data type of a variable.
As Example:
select pg_typeof(3) as type_of;
-- output: integer
select pg_typeof(true) as type_of;
-- output: boolean
Similarly, how to check ...
0
votes
0
answers
11
views
Best process for proxysql?
I have a java application, it connects to master database which has all the mysql users, password, jdbc url, etc. The permissions are set so that each tenant have access to their own database only.
I ...
0
votes
1
answer
16
views
How to setup mongo synchronization with only two nodes?
Im trying to install two nodes of mongo, each one locates in a different location with low latency.
The architecture should be:
One node in DC, and the other node in DR. It is supposed to be only one ...
0
votes
1
answer
8
views
how to build gstore with rdf files?
I want to import files from protege into gStore.
I looked at the gStore documentation, and found out that the bin/gbuild command is followed by a file extension of.nt or.n3.
However, protege exports ....
0
votes
0
answers
15
views
Need to create a duplicate table in a separate schema automatically whenever a new table is being created
Whenever a new table is being created in Schema 'A', I need the table to be duplicated in the Schema 'B'. This should happen automatically. I have searched for trigger concept but it wont work on DDL ...
0
votes
0
answers
32
views
Handling feed and feed subscriptions with document database
I have a data feed that contains channels that users can subscribe to. It's similar to Facebook or LinkedIn where each channel is a topic and users can subscribe to as many channels as they like and ...
1
vote
1
answer
15
views
How to import MySQL RAW Database files without connection error
unfortunately I did not create a 'dump' file with the backup (Data Export) process on MySQL Workbench 8.0.26.
When I copy the old database files to the new Data directory, the server fails to start ...
1
vote
1
answer
67
views
Constraint to enforce that there can be at most 2 instances of a value (or set of values)
A unique index can be used to ensure that there is at most 1 instance of a particular value or set of values. My question is, is there a way to enforce that there be at most 2 instances of a value or ...
0
votes
1
answer
20
views
Initialize transactional Subscriber SQL server
As a requirement to get new data from publisher to subscriber. I used generate new snapshot and run log reader and run distribution agent.
Would like to know which option is we use to initialize ...
1
vote
1
answer
23
views
Does MySQL have a way to limit update/insert statement times?
This is similar to the statement_timeout of postgresql.
I'm looking to have the query error if it takes longer than x seconds.
I'm aware of SET MAX_EXECUTION_TIME, but that only affects select queries,...
1
vote
2
answers
37
views
MariaDB Foreign Key Pair that references System-Versioned Table Record
I'm altering an open-source booking system to match my employer's needs. I'd like to make it so that editing or deleting a service does not necessarily modify or delete the service that is referenced ...
0
votes
1
answer
55
views
Extra `CASE WHEN` Removes Text from Dynamically Created String
I am trying to generate a CREATE TABLE statement based on a given table in my SQL-SERVER database using the INFORMATION_SCHEMA tables, but when I try and concatenate the DEFAULT portion of a field ...
0
votes
0
answers
32
views
Why do I get DAC error even though it is disabled?
I get the following error sometimes:
Could not connect because the maximum number of '1' dedicated
administrator connections already exists. Before a new connection can
be made, the existing ...
2
votes
1
answer
115
views
Query plan looks good, but query slow
I have a table with a hierarchical representation and to model the tree structure, path enumeration is used. Despite the query plan to be optimized and the query itself being straightforward, it takes ...
1
vote
1
answer
32
views
How to extract anonymous row type fields from window function result in PostgreSQL
Context: This question deals with extracting anonymous row type fields in general. The top answer notes that in v13, this was enabled:
Allow ROW expressions to have their members extracted with ...
-2
votes
0
answers
17
views
Setup database mirroring on linux
Hi Anyone help me the below question
Can we set up database mirroring on Linux in SQL Server Standard Edition?
0
votes
1
answer
34
views
In Postgres, duplicate rows on a column are not detected by select group by, but unique index built is failing with duplicate values
I have a table with users and column username. I am trying to build an index on the users#username column but it is failing with an error for a duplicate value. The value detected is an Arabic ...
1
vote
0
answers
24
views
How to find IP subnet that is decomposed into multiple sub-one?
I have a table which like like that:
Id
IpRange
Mask
1
127.0.0.0
24
2
127.0.1.0
24
3
127.0.2.0
24
I'm checking if an IP is in the range thanks to this :
(inet_aton('here is the IP') & ((POWER(...
2
votes
0
answers
30
views
Upgrade and migration of PostgreSQL 10 and PostGIS 2.4 to PostgreSQL 16
I have a really old PostgreSQL and PostGIS bundle (10 and 2.4), that I want to upgrade and migrate to a different server. Upgrading postgres alone wouldn't be a problem, but PostGIS makes it tricky. I'...
0
votes
0
answers
4
views
How to restore a backup and incremental backup of scyllaDB
I am working on incremental backup and restore. When I am trying to restore the incremental backup, after restoration, I am getting an error on cqlsh shell.
ReadFailure: Error from server: code=1300 [...
0
votes
0
answers
33
views
PostgreSQL Failure To Reinitialise Replica With pg_basebackup [duplicate]
I have a master-replica PostgreSQL 9.5 setup.
I'm trying to reinitialize the replica by doing the following:
Stop replica service ( /etc/init.d/postgresql stop )
Clear data directory ( rm -rf /path/...
0
votes
0
answers
48
views
Sql Server migration from old server to new very slow SQLEXPRESS
Hope someone can assist me. I think I might know what the problem is but this is not really resolving the issue and was wondering if it is even a valid conclusion. I am not a Guru at all with SQL.
...