All Questions
99,824
questions
2
votes
1
answer
5k
views
Read concern level of majority error while upgrading Sharded Cluster from 3.2 to 3.4
I have upgraded MongodDB sharded cluster having two replica sets from 3.2 to 3.4. Current storage engine is MMAPv1. After successfully upgrading all the secondary, primary, config server and mongos to ...
5
votes
2
answers
453
views
Statistics histogram AVG_RANGE_ROWS discrepancy
According to MS docs, the description for AVG_RANGE_ROWS is:
Average number of rows with duplicate column values within a histogram step, excluding the upper bound. When DISTINCT_RANGE_ROWS is ...
0
votes
0
answers
5
views
Efficient way to calculate user debt
I'm looking for some idea how to calculate user debt in efficient way.
I have got 4 tables.
user_tab -- definitions of users
item_tab -- definitions of items that we can pay for (internet, phone, ...
0
votes
1
answer
598
views
'Could not fsync file' while running VACUUM FULL on a table
I'm getting an error for around half of my tables in Postgres while trying to run VACUUM FULL.
For example, I have a table named 'qwerty', and when i try to vacuum it i get the following error:
ERROR:...
1
vote
0
answers
84
views
+50
MSSQL Server 2022 on Linux: sys.* tables very slow for non-db_owner users
Querying sys-tables, for instance sys.columns, sys.indexes or sys.tables, has become significantly slower on SQL Server 2022 on Linux for users which are not db_owner. I've used 16.0.4035 which is the ...
0
votes
1
answer
2k
views
How to replicate particular table in MySQL master-slave configuration?
How do I replicate a particular table in a MySQL master-slave configuration?
I have tried replicate-do-table and replicate-wild-do-table.
I tried in my.ini file; is there any alternative to replicate ...
1
vote
2
answers
19
views
Custom Operator Class for BigInt Using Bloom Indexes Not Working in PostgreSQL
I'm currently dealing with a large PostgreSQL table containing approximately 350 million rows. For performance optimization, I'm trying to create Bloom indexes on some bigint columns in my table.
...
0
votes
3
answers
104
views
Is there any assessment tool for SQL Server, something like orachk for Oracle Database?
I'm conducting an evaluation of the new SQL Server environments, and I would like to know if there is any good tool to perform this evaluation in an automated way. I mainly work with Oracle Database, ...
0
votes
1
answer
9
views
Is it possible to check the number of tombstones using SSTable tools without shutting the node down?
Is it possible to check the number of tombstones within SSTable or SSTables without stopping a node (when using SSTable Tools)?
0
votes
1
answer
25
views
Does TTL expiration create a tombstone?
Can someone explain me how TTL actually works
For TWCS I see this process like this:
Within time window 1 we have data with some ttl (in SSTable1)
Then within the time window N the ttl of data from ...
0
votes
1
answer
10
views
Unable to insert large number of records results in timeouts, hung process
We are inserting large records of data into open-source Cassandra database one by one using asp.net core and it result into timeout and process hanged, so I want to know about bulk data insert process ...
3
votes
2
answers
763
views
Merging multiple rows into one in MySQL
I have the following table :
Column1
Column2
Column3
Column4
Account
One
Two
Three
Data1
Acc1
One
Two
Three
Data2
Acc2
One
Two
Three
Data3
Acc3
Five
Six
Seven
Data3
Acc4
Five
Six
Seven
Data1
...
0
votes
1
answer
11
views
Create PostgreSQL partitions automatically
I need help to understand if partitions for PostgreSQL table can be created automatically using triggers.
For e.g., to create daily partition based on range partition and then sub-partitions of that ...
0
votes
1
answer
17
views
Insert rows into a (postgres) table where the first col is a static value and the second col is the result of a SELECT DISTINCT from another table
I haven't had to use SQL in years and I'm clearly rusty.
I have a situation where I'm trying to insert multiple rows into table A.
There are two columns of data to be inserted, the first is a "...
1
vote
2
answers
698
views
csv import fails without throwing an error
Ι am trying to import a csv file into an existing mysql 5.7 table.
Here is the command (the db is in docker with bind mount for persistence)
mysql -h 127.0.0.1 -uroot -prootpass --local_infile=1 ...
0
votes
1
answer
730
views
Conditional default value based on sequence
There is a PG table example with two fk columns table_a_id, table_b_id and position::int column. It's guaranteed there will be only one column filled table_a_id or table_b_id.
CREATE TABLE table_a(
...
0
votes
1
answer
44
views
SQL Server 2014 Cardinality Estimator estimate final number of rows after OUTER JOIN is less than number of rows from initial table
I have a [SQL query] for SQL Server 2019.
It works fine with option
(USE HINT ('FORCE_LEGACY_CARDINALITY_ESTIMATION'))
and very bad without this hint.
I found out, that SQL Server 2014 Cardinality ...
0
votes
2
answers
204
views
Logon error to readonly db
getting error:
"The target database ('MyDB') is in an availability group and is currently accessible for connections when the application intent is set to read only. For more information about ...
0
votes
1
answer
591
views
How to reuse list of columns in multiple statements
I have a list of columns for each entity I want to get from a SELECT/UPDATE/INSERT statement.
I want to reuse the same list instead of having a copy in each query.
Example:
SELECT col1, col2 FROM ...
0
votes
2
answers
32
views
Improving stats for a join to avoid Nested Loops with LIMIT
I have a main fact table t1 with ~6.9m rows, a second dimension table t2 with 1329 rows, and a third table t3 with ~6.9m rows (1-1 with t1, separate because it's produced by a different batch process)....
0
votes
1
answer
11
views
Specify constraints during table creation by select into
Can we explicitly specify "not null" and "primary key" constraints for a column of table that is dynamically created through execution of "select into"? Something like ...
0
votes
1
answer
1k
views
How to insert multiple values and handle conflict at the same time
I have a table where the primary key is a combination of two columns.
When inserting multiple values at a time (batching) conflicts might happen since in the
list of values passed there might be ...
1
vote
1
answer
976
views
PostgreSQL - Replica Recovery Process Stuck frequently (epoll_wait taking too much time)
We have Master Slave Setup with Asynchronous Streaming Replication (Replication Slots). Frequently our Replica's entire Postgres processes seems to be doing nothing (or stuck?). Since ...
-1
votes
0
answers
7
views
How should I run a MongoDB Replica Set (local) if i installed MongoDB via Homebrew, Apple removed access to the root dir
I would like to have opinions and i want to know if there is any way to solve root dir access. I have a Macbook Pro i7 OS 12.4. And i'm with MongoDB latest version!
Any comment/suggestions will be ...
2
votes
2
answers
34
views
Is there a function that adds together all numeric columns in a row?
Using Postgres 15, how to get a sum of columns in each row from a table ?
-86750 | 1728 | 1500 | 61.69 | 415 | 130.18 | 303.99 | 288.57 | 93.44 | 78.06 | 0 | 561....
0
votes
2
answers
5k
views
MariaDB Galera Cluster initial rsync replication failing
I'm trying to install a new galera cluster. The primary host started fine, but the secondaries are failing during the state transfer with rsync, and are not starting. I haven't been able to fix the ...
0
votes
1
answer
25
views
Why am I occasionally getting this error: database could not be selected
This issue is appearing while trying to connect to a Wordpress website hosted on my local machine (localhost).
I am using the XAMPP application, which runs with php 8.2.0 and MariaDB 10.4.27, on ...
0
votes
1
answer
329
views
MySql global variable disconnect_on_expired_password
This is very annoying....
disconnect_on_expired_password is set to ON.
MySql version is:
Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.7.5-m15 - MySQL Community Server (GPL)
...
1
vote
2
answers
4k
views
MySQL database column to Store Phone numberss
What is the best approach to store Phone Numbers (Mobile Number and Office Number) in MySQL table?
Users may have MobileNumber (CountryCode and MobileNumber) and Office Number (CountryCode, ...
1
vote
1
answer
561
views
Triggers: counting rows in a bridge table after INSERT
I'm using a trigger in order to make a Statistic Table. I have this many-to-many relationship where I have an Order that can have multiple Product's and viceversa. So after an INSERT on Order, using ...
0
votes
1
answer
316
views
Repeating rows of date intervals Between dates Firebird
I am stuck in a case that on my financial sys, I need to add a option for value to be monthly, weekly or every 2 weeks
example:
DESC | VALUE | DATEADD | FREQUENCY
--------+---------+--------...
1
vote
1
answer
33
views
Select rows with latest before and earliest after datetime
Suppose there is a table "Events" of types X and Y happened at some datetime. For example:
Type
Datetime
X
30.05.2023 10:00
X
30.05.2023 10:15
X
30.05.2023 10:30
Y
30.05.2023 10:45
X
...
2
votes
1
answer
77
views
Completed Query still blocking?
I ran into an issue in SSMS on a server running SQL Server 2017 where I had ran a query to update the owners of databases, and the query messages tab said that the query completed successfully. ...
0
votes
0
answers
23
views
Migrate of Encrypt Columns from SQL Server 2005 To 2019 RDS AWS
good morning,
Perform a migration of an On Premise database:
Microsoft SQL Server 2005 - 9.00.5000.00 (X64) Dec 10, 2010 10:38:40 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition (64-...
0
votes
1
answer
2k
views
MySQL Group Replication stuck on RECOVERING
I'm testing MySQL Group Replication.
Environment:
Microsoft Azure
Ubuntu 16.0.4
I've followed this guide:
https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-group-replication-on-...
0
votes
0
answers
21
views
How to CONCAT Custom String ONLY into Column Names of Joined Table
I have these two tables company.tbl:
+------------+---------------+--------------+
| COMPANY_ID | COMPANY_NAME | COMPANY_CITY |
+------------+---------------+--------------+
and foods.tbl
+---------+...
0
votes
3
answers
940
views
MySQL Compare Tables and generate delta
I have two exact tables with different data. I need to be able to generate a Mysql View with the following:
All new rows that don't appear in previous_table but appears in current_table.
All rows in ...
0
votes
0
answers
10
views
How to fix PgAgent stuck on "r" on batch step errors?
On windows (10,11 and windows server 2022).
With PostgreSQL 14 and 15.
Pgagent is running as a service.
It runs SQL jobs and access pgpass correctly to run jobs as Local on multiple DBs.
It also ...
0
votes
1
answer
332
views
Oracle - Apply SQL to all schema in database
I'm trying to run the same SELECT against all the schema in my Oracle database.
I found an example of how to do this, but when I try to run it against my database I get the below error:
PLS-00306: ...
1
vote
1
answer
723
views
Change locale of Postgres server
I have a big Postgres server with 2 Tb of data that has been created with the wrong locale.
How can I correct it, without recreating the whole server with pg_dump and pg_restore. It would take a ...
0
votes
0
answers
7
views
update row with age calculation with DOB in related table
SQLite database with a table "events" with a columns events.eventDate, events.ageAtEvent and events.foreignKey_participants, and a table "participants" with columns participants....
0
votes
1
answer
382
views
MySQL upgrading from 5.7 to 8 - Throwing strange error and won't start up
I followed the instructions on the MySQL web site and got MySQL server 8 mostly installed but it won't launch because it fails pretty quickly during the upgrade process. The apt-get portion installed ...
4
votes
2
answers
4k
views
xlog flush request is not satisfied in log files
Today I saw that Postgres produces error messages related to possible data corruption (?). Everything's working as expected so I didn't realize anything was wrong.
ERROR: xlog flush request 6E/...
7
votes
1
answer
3k
views
Using an extended event to track a single stored procedure
I'm attempting to track all executions of a stored procedure (Including from inside other stored procedures) and the statements of that procedure - is this possible with extended events? My current ...
-1
votes
0
answers
5
views
mysql server going slow after split
I had a server running apache + php + mysql but the server load on rocky linux was averagin 5
I split into two servers, one running apache + php and second server running mysql.
both server are on the ...
2
votes
1
answer
3k
views
How to configure AutoMySQLBackup?
How I can configure AutoMySQLBackup to backup some selected tables ones per week while the other tables will be backed up every day?
Thanks.
P.S. My google search ninja skills is not working. :)
-3
votes
0
answers
26
views
restrict having access to rds even when we have master credentials [duplicate]
We need to know how we can restrict having access to rds even when we have master credentials.
we as devops create rds then we get master credentials, using these credentials we can see data in all ...
1
vote
2
answers
4k
views
Mysql upgrade 5.7.22 to 8.0, server not starting after upgrade
I followed the upgrade guide Upgrading MySQL.
Already installed version of mysql is 5.7.22
Verified all Upgrade Prerequisites for MySQL 5.7 Installation
SET GLOBAL innodb_fast_shutdown = 1;
then ...
0
votes
1
answer
26
views
pt-online-schema-change drop_swap doesn't work, so what to do?
After waiting 24 hours for a ptosc this:
2023-05-29T11:29:40 Copied rows OK.
2023-05-29T11:29:40 Max rows for the rebuild_constraints method: 2710
Determining the method to update foreign keys...
2023-...
0
votes
1
answer
239
views
Getting ERROR: invalid transaction termination CONTEXT: PL/pgSQL function run(text,text,text,double precision) line 147 at COMMIT
I am trying to insert the statement and if error then i am rollback and retry the insert statement and commit it to close the transaction. However, i am getting "invalid transaction termination&...