All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
3 views

PostgreSQL: What's the most accurate way to find the network bandwidth of a Query result set

I have been trying to figure out network bandwidth of a Query output, since PostgreSQL only holds I/O bandwidth of Query I ended up in Octect_length() or pg_column_size(). I found below query from ...
1 vote
1 answer
30 views

What factors influence choice between executing remote query using linkedserver via sp_executesql vs using 3 piece identifier

I'm writing a stored procedure that should insert into a local table values from a remote query. The remote server is setup as a linked sever. I have two options: Option 1 is: INSERT INTO ...
1 vote
1 answer
32 views

Index usage for NULL values

If there is index for a column, will it speed up search if condition is ... WHERE column IS NULL? In fact it is composite index on 2 columns and second column can be NULL (WHERE col1 = X AND col2 IS ...
0 votes
1 answer
6k views

(Solved) Sql Server Failover Clustering Error

I want to install always on on Sql server 2019. I have two windows server 2016. I will not use active directory. I do the installation as described on the site where I will leave the link below. When ...
0 votes
1 answer
822 views

Limit size of WAL files for PostgreSQL database

I'm using AWS RDS PostgreSQL 13 database in a master-slave configuration using logical replication with pglogical extension. Recently, one of the application migrations has updated the schema of the ...
2 votes
1 answer
284 views

SSRS ReportServer_XXX.log is giving incorrect CPU count

I am currently investigating an issue wherein sometimes the SSRS just suddenly stops accepting requests until we do an IISRESET command. This happens after we added an additional processor on the ...
1 vote
3 answers
791 views

Manually specifying candidate masters in Maxscale

Looking over the documentation, I haven't quite been able to find if its possible to manually set the candidate master status of a server in Maxscale. The reason I am looking for this is because some ...
0 votes
1 answer
28 views

What are disadvantages of using locktable?

I have many places in my application where users are doing something that should be non-concurrent in per-user-and-namespace bases. So that means that: Two users can press the same button at the same ...
1 vote
1 answer
2k views

Comma separated value string and compare against other values

Hey all I have been trying to wrap my head around how to go about doing this for a while now and I'm not really coming up with anything. Here is my query: DECLARE @ATID AS VARCHAR(3) = 12 DECLARE @...
0 votes
1 answer
628 views

fix InnoDB: corrupted TRX_NO after upgrading to 10.3.31

After upgrading mariadb from 10.3.25 to 10.3.31 it fails to start like described in this bug report I temporary fixed it by downgrading mariadb to 10.3.25 again like I described here. To fix this ...
0 votes
0 answers
29 views

SQL Server Backup Solution - Cleaning Up Dropped Databases

I'm just wondering how people who use Olas (fantastic) SQL Server Backup Solution deal with dropped databases. The CleanupTime and CleanupMode parameters only operate on databases that currently exist ...
1 vote
1 answer
935 views

Resolve Orphan Transaction locking

My SQL Server version is Microsoft SQL Server 2019 (RTM) and I faced a new locking problem. An SSIS package was running. After a while it became suspended by a session with ID of (-2). I know this ...
1 vote
1 answer
21 views

Identify if the sequence of visits to an area id was interrupted at any point

I have a PostgreSQL table df with the following information: area_id trip_nr timestamp a 3 29/06/2022 17:18:03 a 2 29/06/2022 17:18:02 a 1 29/06/2022 17:18:01 b 1 28/06/2022 19:21:03 c 3 28/06/...
8 votes
1 answer
4k views

MySQL query to create a Matrix view using pivot

I have a table with the following fields: p1 p2 s1 s2 where p1 -> player1, p2 -> player2, s1 -> game1, s2 -> game2 The number of players can vary from 3 - 10. The table have the results between them....
-1 votes
2 answers
39 views

Finding unstable query

Sometimes SQL Server execution plans go bad for various reasons. There are copious articles on how to fix bad plans. But how can I find all the SQL in a system that might go bad before they cause an ...
1 vote
1 answer
1k views

Got message: FATAL: expected SASL response, got message type 88

I have a strange situation. A small program working fine till these days (about half a year). The program (NodeJS) is creating a local connection to DB: 1st: creating new connection to local db. 2nd: ...
0 votes
1 answer
1k views

How to update collections and restore while doing mongorestore?

is there any way that i can update the collection and restore the same from dump created by mongodump cmd . when we do mongorestore , it directly restores from the dump , but my requireemnet is to ...
1 vote
1 answer
845 views

MongoDB 3.6 create local Shard db without replica

This is what I want to do: Create a Config Server Create 2 Shard Create a Mongos Router I don't want to replicate my data using replica set, I want to simulate that each shard has only a part of ...
0 votes
1 answer
353 views

Configuring SQL Server management data warehouse (MDW) for data collection

I am configuring a data warehouse on an SQL Server to collect data. However, the process is not finishing and it stays as per below for hours until it is manually stopped: Have you ever encountered ...
8 votes
8 answers
5k views

Reverse Byte-Order of a postgres bytea field

I'm currently working on a table that contains hashes, stored in bytea format. Converting the hashes to hex-strings however yields the wrong order of bytes. Example: SELECT encode(hash, 'hex') FROM ...
3 votes
1 answer
2k views

Can't deploy SSIS package - The certificate chain was issued by an authority that is not trusted

I have an Azure Windows Server in a managed Domain (AD Domain Services) running SQL Server Enterprise. I am trying to simply deploy a local (laptop) SSIS project to the remote SSIS server. When the ...
2 votes
1 answer
2k views

MariaDB I/O capacity with innodb_io_capacity parameter

I use hdparm to test my SSD hard drive I/O benchmark : [root@mail ~]# hdparm -t -T /dev/xvda2 /dev/xvda2: Timing cached reads: 12906 MB in 1.99 seconds = 6477.79 MB/sec Timing buffered disk ...
0 votes
1 answer
17 views

Multiple resultset from mariadb procedure

I am trying to return multiple resultsets from (phpmyadmin) mariadb procedure but am failing. For example I have two tables Entities and Relations and for a test I created a procedure to select ...
0 votes
1 answer
23 views

Why is mycli history file appearing in home directory?

I started using mycli and want $HOME/.mycli-history to be generated and updated from $HOME/.cache/mycli/.mycli-history Moved $HOME/.myclirc -> ~/.config/mycli/.myclirc Created alias mycli='sudo ...
1 vote
1 answer
611 views

MariaDB: granting access to a DB before creating the DB

I've just discovered that I can create a user and grant right to it on a given database even if that DB doesn't exist yet (it will be created in a second step). MariaDB [(none)]> CREATE USER foo2@...
0 votes
0 answers
15 views

INNODB FULLTEXT Index Performance and Optimization Strategy without Down Time

We have an INNODB table specifically for text searching which has a text column and a FULLTEXT index. This table mostly get inserts and updates and almost no deletes in our model. A typical table ...
1 vote
2 answers
2k views

MySQL consuming memory, seeking advice on how to configure it

I have a small VPS that handles my 3 personal WordPress websites. At a certain time MySQL started consuming more and more memory and actually (for months) the server has been running at 99% RAM usage ...
0 votes
1 answer
689 views

Bulk SQL INSERT into Azure SQL Database using spark causes blocking/contention?

I am running the following code using microsoft's sql sparkconnector to write a 1-2 Billion dataframe into Azure SQL Database. df.write \ .format("com.microsoft.sqlserver.jdbc.spark") \ ....
2 votes
1 answer
2k views

Optimizing a recursive CTE or replacing it with a temporary table

I have a recursive query like this: with recursive PCte(id) as ( select p1.id from Product p1 where p1.parent_id is null and p1.serial_number in ('123', '124','125', 'n') union all ...
0 votes
0 answers
22 views

Forward fill Nulls with last known value in group and forecast amounts with limits

I'm a bit stuck trying to do forecasting using rolling avg windows functions across different groups. please see the example table below: I've planned to do this across a few steps e.g. Forward fill ...
1 vote
1 answer
2k views

How to get SQL statement in Db2 database for application that is holding lock on table?

I am trying to get SQL statement that is holding the lock on table. Sample: Create table: create table admin.tab (id int not null primary key, col1 int); Insert data: insert into admin.tab values (1, ...
-2 votes
0 answers
25 views

Problem with my server and all my client pc's gets hanged [duplicate]

I've recently installed SQL Server 2012. But past few days my main server & connected clients (for Billing software) are getting hanged. I've to go offline or restart the system to get better. ...
0 votes
0 answers
8 views

OPC client trying to connect to OPC HDA server and end up in infinite waiting

I am quite new to OPC server/client. I have a service application serves as an OPC client, and trying to connect to OPC HDA server to data reading. There is a list of tags which their value at a ...
1 vote
1 answer
3k views

How to restore Mongo DB tar.gz archive

Using the Mongo DB Atlas cloud service (MongoDB Version: 3.4.16), the below backup archive of a MongDB was generated: Cluster0-shard-0-1531635127-5b4b0df33b34b92b0f50a045.tar.gz In this file I can ...
1 vote
2 answers
541 views

MongoDB specifying shard key and sharding strategy

What is the syntax to state that a collection is to be sharded as location based, while using the range based sharding strategy. I know you have to use the the sh.shardCollection() command, but what ...
0 votes
0 answers
12 views

mysql replication skip some batch delete query

I set up a master slave mysql replication. I have an Event that run stored procedure and delete some rows (about 3500 rows). recently it skip some delete query in slave. for example it does not delete ...
user avatar
1 vote
1 answer
38 views

Data servers: Do query optimisers re-write queries removing redundant columns during the plan creation?

Although I'm using SQL Server, as this is a question of whether an optimiser will re-write a query to remove redundant columns, I'm pitching this at all data servers: RDBMS, NoSQL, MPP, anything ...
0 votes
1 answer
327 views

Is renaming schemas more efficient / faster than drop/create in a single transaction

Given the constraint (from customer side) to having only one database - how can I most effectively deploy new versions of data into a production-facing application. The new data is packaged into a (-...
1 vote
1 answer
186 views

Postgres 14 and pg_trgm index on primary key column make join operations super slow

I've just upgraded my postgres instance from v11 to v14. There was an interesting problem because we have a trigram index on order_id column. This new feature makes our simple join query on that ...
0 votes
2 answers
429 views

Trouble Enabling Query Caching on MySQL 5.6?

Recently I discovered our MySQL 5.6 database is not using any query caching and I wanted to change that. I added [mysqld] query_cache_type = 1 query_cache_size = 50M query_cache_limit = 2M to a ...
0 votes
1 answer
398 views

Window function in Postgres not using index

Let's assume the table, intermediate10, is ~2.2 TB in size. The following query takes ~4 days to run on a pretty powerful DB box (32 CPUs, 256 GB RAM) that is optimized to allow up to 32 parallel ...
-1 votes
1 answer
354 views

In postgres, is using a lock better than transaction when reading data?

I have a race condition in the code for my database, and I'm wondering how I can prevent this using either locks or transactions? (And which is best) I'm using an ORM to update values, however the ...
2 votes
1 answer
480 views

Distribute records on different MySQL databases - MySQL Proxy alternative

My scenario is the following: Right now I am using one big MySQL database with multiple tables to store user data. Many tables contain auto increment columns. I would like to split this into 2 or ...
1 vote
1 answer
1k views

Why does Extended Events server_principal_name return NULL sometimes?

I have an extended event session setup. This is the definition. CREATE EVENT SESSION [Successful-Logins] ON SERVER ADD EVENT sqlserver.connectivity_ring_buffer_recorded ( ACTION ( sqlserver....
0 votes
0 answers
15 views

TSQL query to get metadata statistics like granularity, number of rows, indexes, keys, sort of a broadened INFORMATION_SCHEMA.STATISTICS for TSQL

The MySQL INFORMATION_SCHEMA.STATISTICS table has these columns: TABLE_CATALOG The name of the catalog to which the table containing the index belongs. This value is always def. TABLE_SCHEMA The name ...
1 vote
1 answer
1k views

PostgreSQL WAL file database system identifier wrong

I'm having a problem restoring a copy of a PostgreSQL database to another server. I have taken a backup using the pg_basebackup tool and can restore that but when I restore WAL logs from the archive ...
0 votes
2 answers
370 views

How to improve query count execution with mySql replicate?

For my report I have to use count queries (name 'user_activity' for example) and then group by by another column (user_type) in another table (user table). And its really time consuming when it ...
1 vote
1 answer
1k views

How to select recursively in a child parent design situation (in MySQL)?

Let's take into consideration the following tables: CREATE TABLE actions ( id BIGINT(20) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, name VARCHAR(255) NOT NULL, user_id BIGINT(20) ...
-1 votes
1 answer
16 views

Embedding PHP variable into Sqlite statement

I have been struggling with this for hours. I am pretty new to Sqlite and have been trying to write a prepared statement, everything works up until I try to get my variable in. The following works as ...
0 votes
2 answers
529 views

SSIS package randomly fails with "WriteToServer requires an open and available Connection" error

Our SSIS package randomly fails with the following error message: An exception has occurred during data insertion, the message returned from the provider is: WriteToServer requires an open and ...

15 30 50 per page
1
2 3 4 5
2057