All Questions

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

Querying system health data is sometimes fast and other times too slow

We get the data from system health XE within SQL server and load into tables for later querying. Part of that statements which gets pretty slow is INSERT INTO TABLE1 ( [object_name] ...
0
votes
0answers
7 views

“Diamond Shaped Relationship” What's the formal term?

Consider the following "Diamond-Shaped" entity relationship diagram: I'm trying to find some formal readings on why this is a bad design - but Googling "Diamond Shaped Table Relationship" only turns ...
0
votes
1answer
13 views

Search one array element with another

I have got tables: children_tab id name lastname parent_tab id name lastname children_parent_tab children_id parent_id There is also parent view that return in field children_ids elements from ...
0
votes
0answers
28 views

Column as an Included column or as a key column

I have a query which has an optional where condition on column classID(not unique). This same classID is being displayed as a select column in various other queries. Currently i have classID as an ...
0
votes
2answers
24 views

How to select values side-by-side

I have a table like this id_project id_field value 1 1 abc 1 2 xfe 2 3 ufj 2 4 osj And I have to export ...
1
vote
0answers
7 views

mysql data node not connecting to node manager on AWS EC2

I am trying to setup mySql manager + data node + sql server (Server A) and another data node cluster on (Server B). Both running on Ubuntu 16.04 amd_64 Server A /etc/hosts also on Server B Both ...
1
vote
1answer
29 views

I need help with a SQL Query. SQL beginner here!

I'm totally new to SQL and I've inherited a customer's server (the company that managed it no longer exists). They need me to run a SQL Query that shows their inventory sold for pots. Specifically, ...
0
votes
1answer
11 views

Merge multiple rows in table setting one column based on value in rows

I have some data that looks something like this: key B 1 true 1 false 2 false 2 false And I want to roll it up so that if column B has two false values then the resulting value for B is ...
0
votes
0answers
9 views

How do I manage SQL Server Management Studio (SSMS) Add-In?

A variety of vendors provide SQL Server Management Studio (SSMS) Add-Ins, such as Red Gate's SQL Prompt and the SSMS Tools Pack. Is there a way in SSMS to control or configure these add-ins (enable/...
1
vote
0answers
8 views

ALTER TABLE DROP COLUMN - server status 'Stopped'

I am in the process of removing 4 columns from my (MySQL/innodb) table, simple code, ALTER TABLE database_name.table_name DROP COLUMN A, DROP COLUMN B, DROP COLUMN C, DROP COLUMN D; It has been ...
0
votes
0answers
4 views

Barman + repmgr failover process

I am about to build a PostgreSQL 11 cluster with Repmgr and Pgpool II, and I want to use Barman for backups. The result will be a PostgreSQL cluster with one master node and two standby nodes: ...
-1
votes
0answers
18 views

SSIS Package won't run SQL agent

I've upgraded my sql server and moved all the Databases and agent jobs to a new server from 2012 to 2016 and exported and imported the SSIS packages. I have maintenance job which run a SSIS package ...
0
votes
0answers
11 views

MySQL - too large temporary table on disk

I have two servers with identical MySQL versions (5.5.50, pretty old), identical my.cnf, identical SHOW VARIABLES and three identical tables with identical indexes and different data. And I have a ...
-1
votes
0answers
13 views

Why does pgAdmin 4 run slower than pgAdmin 3?

I have PostgreSQL 10 with pgadmin 4. I try to run an update query for a 600k table. UPDATE 607237 Query returned successfully in 3 min 20 secs. I download and install pgadmin 3, even when said only ...
3
votes
4answers
68 views

Why would shrinking TEMPDB log lead to slowness?

I recently accidentally shrunk tempdb log to almost 0 after getting alerted that log drive filling up. I am told that it will lead to slowness. Can someone please explain why it will lead to slowness?
-1
votes
2answers
25 views

What is the last version of postgres with pgadmin 3?

For some reason I cant get used to the pgadmin 4 in web version. I found it very slow. For thing I want do fast I rather have pgadmin 3 even if that mean work with previous version of postgres. So ...
0
votes
1answer
20 views

Is it safe to add more than primary data file to Temp DB in SQL server 2008 R2 as we have database server with 4 Core processor?

Is it safe to add more than primary data file to Temp DB in SQL server 2008 R2 as we have database server with 4 Core processor and please tell me the steps to do it .And does it will tune ...
1
vote
0answers
14 views

REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT for Readscale AG failover

I have 2 node Readscale AG setup where each node is on a different data center. I want to know if SET (REQUIRED_SYNCHRONIZED_SECONDARIES_TO_COMMIT = 1); needs to be run even after setting both the ...
-1
votes
0answers
18 views

DBDEFENCE for SQL Server [on hold]

Has anybody used DBDEFENCE as SQLdb encryption solution in production? If yes, Could you provide a overall feedback about it(like Reliability, performance,durability, easy etc). Thanks
0
votes
2answers
28 views

Table function in oracle

I want to create a function that will return a table as a result. Now, I have written quite a big SQL that works, but as I need to push dates trough that SQL to the beginning, I need a funtion that ...
0
votes
0answers
4 views

Issue in projecting field using findOneAndUpdate in embedded array Mongoose?

Currently my User model looks like: { _id: 'SomeId' firstName: 'John', lastName: 'Cena', books: [ { _id: 'xyz', title: 'a', author:'b', ratings:[ {source:'source1', ...
1
vote
0answers
19 views

Football Matches - build temp standings table for each Gameweek

I have the following data in a sql database and i need that for each game in the table to add new columns with the Rank in Table, Number of Points and Goals Scored at home, for each Gameweek (the ...
0
votes
3answers
35 views

SQL server 2016/2017 in terms of better performance

Which SQL version or edition should we use out of SQL server 2017std/ent or 2016std/ent in terms of better performance gain when you are dealing with SP's (approx 1000 or more)in single database which ...
1
vote
1answer
35 views

Install last CU for SP2 without installing SP1 in sql server

A client asked me to update their SQL Server. It's an 2016 base release (13.00.1601.00) Microsoft already released the SP2 CU10. I know that cumulative updates are... like... cumulative, but even ...
0
votes
1answer
32 views

How to use comma separated columns in CASE WHEN Statement?

I am trying to add below CASE WHEN Statement in SQL WHERE Clause, But SQL Server not allowing me to do so. All column used are of same Data Types but still its giving me error, Can anyone please check ...
4
votes
1answer
82 views

Deadlock Graph - Surviving Statement inputbuf does not show the object that was locked

I have captured a deadlock on my system and the (anonymised) XML output is as follows: <deadlock> <victim-list> <victimProcess id="processf4d9233468" /> </victim-...
0
votes
0answers
15 views

Designing Doctor-Pacient access permissions

Id like to have several admins which in this case are "doctors" which will have access to their patients, however, a patient might have more than one doctor who has access to their data. What is the ...
0
votes
1answer
38 views

Deadlock in SQL Server

I have been trying to resolve this deadlock for a while now with no success, its seems like the users are opening multiple tabs when executing this task. Below is the deadlock trace from red gate. Can ...
0
votes
1answer
17 views

Nothing is written to log in log_directory() for a PostgreSQL cluster

Running PostgresSQL 11.4 on Windows 10 I made a DB cluster in C:\Users\WindowsUser\AppData\Roaming\postgresql\Db_1 I registered that cluster to start on as a windows service on startup: pg_ctl ...
0
votes
1answer
15 views

Cross Database with Application Role

I have a requirement to access (read) a table/view in database B from database A. The application that needs to execute the query however uses an Application Role. From what I've read and tried, doing ...
2
votes
1answer
15 views

Time Difference Between actual total time and execution time in EXPLAIN ANALYZE

I have the following output of EXPLAIN ANALYZE query on PostgreSQL 11.5 EXPLAIN (ANALYZE, VERBOSE, BUFFERS) SELECT actor.actor_id, actor.first_name, act.num FROM actor INNER JOIN ( SELECT ...
0
votes
1answer
33 views

How to find average of transactions every 15 min in Sql server for last 7 days?

This question might not be new in forums , but struggling to get the expected out put. Please any body share the similar requirements if we face with solutions. I would like to find average of total ...
0
votes
1answer
14 views

MySQL query is taking a long time to execute

I have a performance issue with a MySQL query that takes a long time. I'm trying to figure out why and what is Block nested loop? MySQL Version is 5.6 and Running on Cloud The query that works but ...
0
votes
1answer
17 views

MSSQL 2016 Rearranging data after importation [on hold]

I have data from a 3rd party system in excel. when I import the data to SQL server 2016 table the data is rearranged and I can't work on it since the data is grouped
0
votes
0answers
20 views

indexing reference to multiple tables based on type

I have a rather simple "social network" scenario , with Posts (which can include Media, like photos), and likes & comments. Post can have Likes and Comments by different users. Post can have ...
0
votes
0answers
25 views

Granting temporary sysadmin rights

Using SQL Server 2017. I have an issue that I need to allow a Windows authenticated user the ability to read excel files that are on the network. They have public rights as well as a host of different ...
0
votes
1answer
20 views

Log shipping backup

I m confused with backup for log shipping,by taking full backup(not copy- only) in primary ,does it affect the log backup LSN chain and cause log shipping not to work? If it does not affect LSN chain, ...
0
votes
0answers
15 views

Output should return only real values [on hold]

A table has three columns A, B, C these columns contain values with combination of both NULL and non NULL record in all columns. a query is required to return only not NULL values from all columns. ...
6
votes
1answer
361 views

Replace long GROUP BY list with a subquery

This is a repost of my question on Stack Overflow. They suggested to ask it here: I found an online article from 2005, where the author claims, that many devs use GROUP BY wrong, and that you should ...
1
vote
1answer
23 views

composite index on bigints

I have a User Relations table, which basically stores all the one-directional relations of users. For example , User A follows user B ; User X blocks User Y User ids: the id of users are bigints. It'...
-1
votes
0answers
34 views

Name matching - 1 million row under 1 seconds [on hold]

I have requirement to have fuzzy name matching for around 1 million row under 1 second. I use a simple Jaro Winkler function for 20k row it cost around 5 seconds to execute and the rate increase ...
0
votes
0answers
10 views

Getting Connection Error on MySQL5.1 to MySQL8.0 ROW Based One Way Replication

Trying to replicate MySQL5.1 to MySQL8.0, when running starting the slave on MySQL8.0, I get [ERROR] [MY-010584] [Repl] Slave I/O for channel '': error connecting to master 'rep_user@XXXXXXXX.YYY:...
0
votes
1answer
10 views

How to optimize count(*) using only foreign key index on PostgreSQL

I have a web app that extensively uses data tables that connect to the database to fetch data. The problem though, it always needs first to count the total results before it could paginate the data by ...
0
votes
1answer
28 views

How to output string values in single quotes?

I'm trying to convert values stored in a json into its string representation. The #>> operator works for this purpose for numbers, e.g.: SELECT '{"a":[1,2,3],"b":["4","5","6"]}'::json#>>'...
0
votes
1answer
30 views

Get notification about invalid views

I have 40 views that are integrated/synced to a work order management system on a weekly basis. The views are based on GIS tables which are notoriously messy. Over time, the views can end up becoming ...
1
vote
2answers
40 views

Is DB mail supported on SQL Server hosted on Azure VM (IaaS)?

Is DB mail present in SQL Server hosted on Azure VM (IaaS)? If DB mail is not supported, then what are the features available?
1
vote
2answers
63 views

How to check actual execution plan of a query after it has been executed

In SQL Server, how can we see actual execution plan of a query, after it has been executed? As per my knowledge, only estimated execution plan (not actual execution plan) are stored in plan cache. is ...
0
votes
1answer
20 views

Querying sys.server_principals does not return results for specific user

I'm trying to figure out why this query: SELECT * FROM sys.server_principals WHERE sid = SUSER_SID('Domain\User') OR name = 'Domain\User' Does not return results for one specific user? At the same ...
0
votes
1answer
24 views

Import a large MySQL dump 68GB on RDS instance

I tried to import a large MySQL dump.sql (68GB) on RDS AWS instance MySQL 8.0 (db.t3.2xlarge: 32GB RAM). The import takes more than six hours: More than 500 tables I have 2 large tables: the first ...
-3
votes
0answers
13 views

How to read millions of records effectively with more joins? [on hold]

Im developing an enterprise application using node js as backend and mysql for database for one of the telecommunication company. I'm currently working in rewards module like grabbing and redeem ...

15 30 50 per page