All Questions

0
votes
1answer
19 views

AlwaysOn availability group and Replication - expected behaviour

I'm currently doing a bit of testing with alwayson and replication. I currently have the below: Fully working cluster and Always on environment; DCTEST1, DCTEST2 and the listener name DCTEST_L. The ...
0
votes
1answer
29 views

Orphaned users with their respective database name [duplicate]

I need to get a list of the orphaned users in each DB, together with the database name in which they are found in. I did the below which gives the orphaned users in each DB, but I cannot figure out ...
0
votes
0answers
19 views

Do UPDATE statement performance affect indexed column(s) in Postgres?

I have a table which is having millions of rows. While doing update I'm using primary key column in WHERE clause and it uses index scan as per the EXPLAIN plan (within BEGINand ROLLBACK block). I have ...
2
votes
1answer
79 views

An error occurred on the always on dashboard

I have a setup of Windows Server Failover Cluster and i am using SQL Server Service with one DC, One Primary Server and One Secondary Server. During Using SQL Server Management Studio, when i click ...
0
votes
0answers
23 views

Create trigger and check if value exists in a table, if exits raise exception [on hold]

I am trying to learn triggers in PostgreSQL. So Now I want to insert some records into a table. Before that, I need to check whether that records exist in table or not. If present raise exception, ...
-1
votes
0answers
26 views

SQL Server / Statistics IO - TI_GoodFlowBody [on hold]

What do tables like 'TI_GoodFlow' in messages output mean? I have an old heavy script heeded for optimization, but when I run statistics io on it I aquire stats with unknown tables, which have very ...
0
votes
0answers
5 views

WebSync Replication over HTTPS URL between SQL Servers on Cloud and on Intranet behind Proxy

I have a SQL Server instance running on company intranet behind a web proxy server. On cloud, I have an other SQL Server instance. I tried to implement WebSync method using replication between these ...
0
votes
2answers
51 views

Triggers vs. Jobs in SQL Server

I’m designing a database with a table that automatically gets loaded with a new record every 15 seconds (each record will have a 'timestamp' field and around 50 ‘float’ fields). Each record in this ...
1
vote
3answers
48 views

Mysql innodb table dead lock while batch update in multiple thread

I've two tables of innoDB type and I'm updating one table using batch statement from 10 thread (one batch statement per thread) but some time I'm getting dead lock. java.sql.BatchUpdateException: ...
1
vote
2answers
29 views

Can I avoid this cursor?

Let's say I have two tables in a banking application and table names are all_transactions and helpline_requests. The 'all_transactions' table keeps track of all kinds of transactions including ...
0
votes
0answers
17 views

Update password across all SSRS reports within a folder in Reporting services 2016

I am going through a manual intervention of manually updating the password in data source section for all the reports in SSRS2016. This is very tedious as i need to update this across 40+reports ...
-1
votes
0answers
19 views

Compare 500 files and load only distinct record

I have 400 to 600 different files and with same data type. But in these files, we have so many duplicates record in all the files. In my folder, there are A.txt, b,txt, c.txt files are there. It ...
0
votes
0answers
21 views

Is there anyway to make my sql server collect repositories from GitHub? [closed]

Hi Is there any way for me to make my database check for repositories in GitHub and add them to the SQL server? So if I add a repository in my account like 'CODEX' it would push the name and other ...
-1
votes
1answer
38 views

How to print a query from many rows in one line? [on hold]

In SQL Server 2017, I have a many-to-many table: ========================= id nameID phoneID ========================= 1 1 1 2 2 2 3 1 3 ...
0
votes
0answers
28 views

PostgreSQL 9.6 slow UPDATE on production server compared to local machine

I have a production vm with centos 7.6 under hyper-v and a windows 10 laptop as a dev machine and both are running postgresql 9.6, on my laptop 10k UPDATE queries only take 9 seconds while on the ...
-2
votes
0answers
17 views

Rebuilding Indexes [on hold]

I'm working with a db where I have tons of fragmentation issues. I'm rebuilding some of these indexes. Can anyone tell me how come the fragmentation of an index is not 0 after the rebuilding process. ...
1
vote
3answers
41 views

Does pure MongoDB use schemas and models like Mongoose?

I'm new on pure MongoDB and I've some questions about pure MongoDB. 1. Does pure MongoDB use schemas and models like Mongoose ODM? If you have used Mongoose ODM, you know that Mongoose ODM uses ...
4
votes
0answers
56 views

Is there a way to improve performance of this simple SELECT query?

I'm still relatively new to MySQL so please forgive any ignorance on my part. I've tried looking through other posts on here and StackExchange, but haven't had much luck in improving the performance ...
0
votes
0answers
10 views

Is there a way to restore contents of pg_largeobject for BLOB data using pg_restore?

Product: PostgreSQL 10.3 We have a need to take a copy of our production database and restore that into a separate environment for testing and training purposes. The problem is that the database is ...
0
votes
1answer
24 views

“Pausing” log shipping to allow normal DB use. Is this process valid?

I am in the process of migrating a server to AWS. Right now it is just for Dev/QA work, but will eventually be turned into our production server. It is a 2 node AG. Server is all up and running, ...
2
votes
1answer
67 views

Intermittent Login Issues with Windows Authentication

I have a strange one. I've been experiencing occasional login errors via windows authentication for the past couple weeks and the network team and I have yet to find a solution. I am running SQL 2016 ...
2
votes
0answers
17 views

Multiple Location AlwaysOn and Azure SQL Server

AS with the majority of projects, the original scope may not be a viable option. We were using Azure Data Sync and transaction replication to keep the 4 site databases in sync. However, the customer ...
1
vote
1answer
54 views

Calculating disk usage with INFORMATION_SCHEMA.TABLE versus file system?

MySQL's database size can be calculated with SELECT table_schema AS db_name, SUM(data_length + index_length) AS size FROM INFORMATION_SCHEMA.TABLES WHERE table_schema != 'INFORMATION_SCHEMA' GROUP BY ...
1
vote
1answer
79 views

How can I calculate future interest charges and loan balance

I have a table like below: Need to calculate interest for next month 100*(4.29/100). Row+1:Capital_Balance = Row:Capital_Balance_Calculated - Calculated interest from above step. Resultant table is ...
0
votes
1answer
30 views

PostgreSQL copy fails ERROR: missing data for column “column name”

We are importing bulk data i.e millions of records. We observed that due to a null value for a column , the import is getting failed. Is there a way we could skip the import error when a record is ...
0
votes
1answer
30 views

ON CONFLICT ON CONSTRAINT fail postgresql

INSERT INTO O_USER (ID, NAME, LASTNAME, EMAIL, USERNAME, PASSWD, DATE_REG, DATE_UPD, DATE_DEL, IS_DELETE, TIPO, FTP) VALUES (%s,%s,%s,%s,%s,%s,DEFAULT,NULL,NULL,%s,%s,%s) ON CONFLICT ON CONSTRAINT ...
0
votes
1answer
50 views

SQL Server Authentication

I am able to access a database using the Windows Authentication method in DBeaver. However, when I switch to different account in Windows and I would like to access the datebase, I used SQL Server ...
0
votes
0answers
32 views

MySQL Error seems unfixable: Index column size too large

I'm getting: ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes. There are many questions about this here, I tried many of them. No luck. My context: MySQL 8.0.13 ...
5
votes
1answer
113 views

Can we download SSRS 2017 to use with SQL Server 2016?

We are using our organization's SQL Server 2014 SP3 servers. (They also have 2016 SQL Servers, but we elected to skip 2016 and just move to the next SQL servers when they get installed.) We have a ...
0
votes
0answers
11 views

Conventions/Rules for the entity relationship modelling (ERM)

In an exam past paper I am asked: Use Entity Relationship modelling to identify relations, including attributes and indicating primary and foreign keys. The narrative is as follows: A Pizza joint ...
6
votes
1answer
78 views

Understanding Plan Choice When Query Store Doesn't Respect Forced Plan

I'm trying to figure out a situation that I encountered last week where, in an attempt to temporarily fix a plan regression during an incident, I forced an execution plan using Query Store, but found ...
0
votes
0answers
19 views

Does the MySQL slow query log include network delay?

If I have a query, that itself is executed fast and is using an index, so the only part exceeding the time threshold itself is the network layer, does this query still get logged in MySQL ...
0
votes
1answer
19 views

pg_xlog_archive folder size is very big

While doing DB operations on PostgreSQL pg_xlog_archive is consuming more than 150GB disk space with the option "archive_mode = on". How to cleanup/reduce pg_xlog_archive folder size. What will ...
4
votes
1answer
56 views

How to avoid deadlock for this query?

I am running a MySql 5.7 database and I have a query which results in a deadlock as it is running in multiple threads. I am trying to figure out how to avoid this deadlock, but so far I haven't been ...
3
votes
1answer
27 views

MariaDB configuration for many updates, writes

Based on few tutorials that I show I created the following MariaDB configuration for my server. Server has 32 GB ram, SSD, 8 cores and is dedicated to run MySQL. The biggest table has about 1,5 ...
0
votes
2answers
24 views

MySQL, IF statement, variables, and NULL

After struggling for too long with something that should have been simple, I had a question to ask, but while writing it, I kept looking for solutions and I finally found the solution. I am posting it ...
0
votes
0answers
16 views

Is there any global variable for PostgreSQL replication has configured or not

Is there any unique identifier or any global variable which can tell us if replication is configured in current PostgreSQL server. Other than this query select pg_is_in_recovery(); The above ...
-1
votes
1answer
78 views

Sniff MSSQL Connection String

Let's say, there is an .NET application on a windows 7 host where I have administrator's access rights. The application works with remote MS-SQL server on port 1433 which I don't control. I want to ...
0
votes
1answer
28 views

What Geopartioning or distributed SQL database can I use? [on hold]

I want to split medical data on multiple nodes because I have Swiss, Europeans and Americans and I need to store data in citizen country. I don't want to manage this function in App but in the SQL ...
0
votes
1answer
35 views

MySQL schedular every day in a time periode every hour

This schedular i made doesn't work how i would like it to work. The idea is that it will run every day in a time periode from 06:15:00 till 23:59:59 and in that only periode run every hour That ...
0
votes
1answer
21 views

Is there any unique identifier for PostgreSQL? How can the master identify its slave unqiuely?

Is there any way to have more than one PostgreSQL slave servers in the same system. If yes, how come a master detect each server as different slaves from the below query select * from ...
0
votes
0answers
8 views

ERROR: cannot update table “pg_enum” because it does not have a replica identity and publishes updates

I was trying to update the enum label using the following SQL query UPDATE pg_enum SET enumlabel = 'Cash Recivied' WHERE enumtypid = '1203702' AND enumlabel = 'Cash'; but it throws an error ERROR: ...
0
votes
1answer
17 views

How to remote connect with PostgreSQL 11 CentOS server?

My Server: CentOS 7 x64, PostgreSQL 11.2 My Client: Navicat, pgAdmin 4.5 . Error at client: FATAL: no pg_hba.conf entry for host "14.248.254.146", user "postgres", database "postgres", SSL off I ...
0
votes
0answers
17 views

Query is faster with additional JOIN

SELECT COUNT(DISTINCT User_id) FROM Session GROUP BY Floor_id; SELECT COUNT(DISTINCT User_id) FROM Session JOIN Floor ON Floor.id = Floor_id GROUP BY Floor_id; The second query runs 20x faster ...
0
votes
0answers
18 views

MySQL Query to Display Organized by Date

I'm good with basic types of queries but this has me stumped. I have the table schema listed below, I need display the results in a table, with each row displaying the available results for a given ...
1
vote
1answer
40 views

MySQL: need help making a query faster

I wrote a query that finds me records in discovery table that contain a needle from whitelisted (LIKE %needle%) and don't have a record in logs table (and some other easy to understand filtering): ...
1
vote
1answer
18 views

Create Trigger that updates the same table before (or after ??) the Insert

I have just started using triggers and one thing that I would need to do is to create a trigger that updates the same table that's inserting the row. TABLE: CREATE TABLE `city` ( `city_id` ...
0
votes
0answers
25 views

MySQL How to get first row from subquery when using aggregate function

This is my Query: SELECT COUNT(runs_scored) - SUM(IF(extra_type_id = 4, 1, 0)) AS Balls, SUM(runs_scored) + SUM(IF(extra_type_id IN (2 , 4), extra_runs, 0)) AS Runs, SUM(...
2
votes
1answer
91 views

Memory Optimized table: Index size 10X bigger than data

On one of our production servers, I found out that Index size is 10X times bigger than data size. These servers and schemas are identical with a similar workload. CREATE TABLE [dbo].[...
0
votes
1answer
14 views

MariaDB Multiline RegEx

I'm running a SQL query in MariaDB under PHPMyAdmin as follows: select REGEXP_REPLACE(post_content,'(?m)<noindex>[.\r\n]*</noindex>','') from wp_posts where ID = 318 I'm trying to ...

15 30 50 per page