All Questions

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

BigQuery - how to think about query optimisation when coming from a SQL Server background

I have a background that includes SQL Server and Informix database query optimisation (non big-data). I'm confident in how to maximise database performance on those systems. I've recently been working ...
0
votes
0answers
4 views

Getting error ER_SP_DOES_NOT_EXIST on MySQL db function, when function DOES exists

I have server with ~100 databases with same structure for each client. Clients manipulate data that come to node.js script and after write to database (I am using mysql-node nodejs module). Last time ...
-2
votes
0answers
17 views

HOW TO UPDATE MILLION RECORDS IN ORACLE

I have a partition by table I need to update 200 million records using the column value from a single partition which contains latest data.I tried bulk collect and for loops but it did not work.Kindly ...
0
votes
0answers
14 views

One table to hold all ids related to one user - bad idea?

I was wandering if it's a very bad idea to have one table that holds all the ids related to one entity? For example let's say i have 3 tables each containing data about one user. Should i use an ...
-4
votes
1answer
18 views

the login is from un trusted domainand can not be used with window authentication

I am facing this issue after trying to run window application on sharing client side on workgroup envirnoment,while this application working on server machine fine
-5
votes
0answers
27 views

Same execution plan but huge difference in execution time. CREATE and DROP INDEX resolves problem. Why?

I'm moving database from MSSQL 2008R2 to 2016. I have my own procedure which runs MERGE on 3GB table (syncs rows in same table of different "class"). After moving to new MSSQL I found that ...
0
votes
0answers
9 views

How does MVCC store different versions in the filesystem

As in, I understand in general as to how MVCC maintains snapshots etc but I'm unable to translate this into code. Say there exists a database which has 10 rows. I'm guessing with each of these 10 rows,...
0
votes
0answers
8 views

sudo systemctl restart mssql-server hangs

When installing Red Hat Enterprise Linux Server release 7.6 (VM) minimal install, I followed these steps for MS SQL installation: sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages....
0
votes
1answer
13 views

Postgresql 11 SSPI authentication failing

On windows 2016 in AD setup when I try to use SSPI with postgresql 11 and following settings : pg_hba.conf: host all all 127.0.0.1/32 sspi map=newmap #IP4 pg_ident.conf: newmap ...
0
votes
0answers
2 views

Galera throws “WSREP has not yet prepared …” error but nodes are working

Yesterday we moved from 2 node Galera to 4 node Galera with a brand new infrastructure. But after we move the database, Galera started throwing "WSREP has not yet prepared node for application use" ...
-2
votes
0answers
33 views

The best SQL server for client/server system (direct connection), performance/security?

Which relational database server does handle a two-tier client/server setup best? I'm about to create a WinForm .Net client and don't want to develop a mid-tier server. Many client connections: Which ...
0
votes
1answer
8 views

MySQL query takes too long in codeigniter

I've made this query SELECT id,name,iupac_name,inchi_key,molecular_weight,molecular_formula,exact_molecular_mass FROM compound WHERE name LIKE '%quer%' OR iupac_name LIKE '%quer%' OR ...
0
votes
0answers
6 views

Trying to create 2nd instance of mariadb on windows server

I have a windows server with MariaDB (10.2.14-MariaDB) and I'm trying to install a 2nd instance on it. I have 1 instance working using port 3307. I used mysql_install_db to install it on port 3307. I ...
0
votes
1answer
20 views

MySQL Simple pivot table with MAX(), GROUP BY and only_full_group_by

I'm having trouble using GROUP BY with only_full_group_by. Here is my employee_job table: +----+-------------+--------+------------+ | id | employee_id | job_id | created_at | +----+-------------+---...
1
vote
2answers
26 views

Int for identity/primary key and Guid for public identifier, best practices?

I almost always use an int for identity/primary (auto incrementing) clustered key for my tables. They're easy to query and debug, bounce around in SSMS, and plenty of other reasons. I have a case ...
-1
votes
1answer
15 views

Which is faster: using HAVING with COUNT or WHERE with IS NULL?

I have 3 tables: video, video_category and video_category_join. One video can have multiple video_category and a video_category can be associated with multiple videos: therefore the ...
0
votes
0answers
9 views

Unable to add new instance on MySQL InnoDB cluster

I'm setting up new MySQL InnoDB cluster 8.0.16 consisting of three instances: srv-mysql-01 srv-mysql-02 srv-mysql-03 I run JS-script in mysql shell for build cluster: mysqlsh --interactive --file=/...
1
vote
2answers
32 views

Why this query giving wrong output?

I want to find review group by ratings 1,2 etc and for doing so i write below query but this giving wrong info. This is the query: SELECT CASE ur.rating WHEN ur.rating between 0.5 and 1 ...
0
votes
0answers
14 views

The security definer of my stored procedures suddenly changed on a shared hosting server

I'm on the verge of jumping down someone's throat and want to be sure I didn't somehow cause this. I am building a website on a shared server hosted by a top-three hosting company. Last night, while ...
0
votes
2answers
25 views

how to use the same timestamp along several tables?

Lets say a have 2 tables and both have a datetime column. On table A, on datetime column, lets say, ts1, is non null, default is CURRENT_TIMESTAMP and on update CURRENT_TIMESTAMP; The other table, B,...
0
votes
1answer
10 views

Slow Query not using index in one of the tables

My Rails table structure is like this: a User has_many Contacts, which have one Reservation each, which have many ReservationNotes each. I'm trying to get all the ReservationNotes for the contacts ...
0
votes
0answers
16 views

MySQL 8 roles - I'm probably missing something obvious

I'm trying to use roles in MySQL 8, and failing. I have read the documentation and as far as I can tell, I'm doing it right. Since this is a 'hello world' level attempt, I assume I'm missing something ...
-3
votes
0answers
8 views

how to draw a ER

Pizza Hut – Sri Lanka You are required to design a DB for Pizza Hut, Sri Lanka to support the following business activities. a) Maintain details of the range of products (Cheesy onion, Chicken Bacon ...
0
votes
1answer
13 views

Column with Default value as Sum of TIMESTAMP

I have a table which has 2 columns ( JobDate , RecordTime) -------------------------------------- JobDate | RecordTime | SumCol -------------------------------------- 2019-07-20 | 2019-07-...
0
votes
0answers
16 views

How is the behaviour of backupset in RMAN?

I found this definition on WEB: A logical grouping of backup files -- the backup pieces -- that are created when you issue an RMAN backup command. A backup set is RMAN’s name for a collection ...
0
votes
0answers
17 views

can't join a freshley started mariadb galera cluster

I'm at my very first clustering experience. I need to create a MariaDB Cluster. Currenlty I have two servers but I planned to add 1 more in the future. Now, I have: maz-pihole (a debian 9 based OS ...
0
votes
0answers
17 views

MariaDB SPIDER engine

I am trying to include just one table from another MariaDB server (lets call it A) into the database on another (even physical) server (lets call it B). And I came up with the conclusion that SPIDER ...
0
votes
0answers
19 views

Most efficient way to insert records with unique sequential numbers?

The first record should have the serial number 0 (or 1) and each new record should get the next available sequential serial number scoped by a foreign key. What is the most efficient way to ensure ...
0
votes
2answers
23 views

Running a task without waiting for the results in Postgres 11 on RDS

I've got a question about spawning stand-alone threads on Postgres. Here's what I'd ideally like: Have a postgres-side solution to automatically launch tasks on a schedule in their own threads. ...
0
votes
0answers
11 views

Storing dates and their history of changes and emailing - Does my database design pose any problems?

Background I'm designing some tables to allow dates to be assigned to an object so progress can be tracked on that object, along with functionality to store emails sent pertaining to these contracts ...
0
votes
0answers
11 views

How to implement row count for REST API?

I’m building a REST API backed by PostgreSQL. I'm encountering something I don’t think is very niche, but I’m having trouble finding any discussion of it. Good REST API practice dictates that if a ...
1
vote
0answers
15 views

HQL Injection Question

This question popped into my head after reading this article. However, the more I read about this topic, the more it seems like a Dynamic SQL security issues. So i have 2 questions mainly: Is there ...
0
votes
0answers
14 views

how to search in language and get results for another language

I have two tables product |----|---------------------| | id | code | |----|---------------------| | 1 | A | | 2 | B | and product_tarnslation |...
3
votes
1answer
54 views

Sql server, altering column to smaller size

I'm doing a project that's adding some columns to a fairly badly designed table, and I noticed that it's got a lot of wasted space. I see a lot of posts about adding columns on the end being ...
0
votes
1answer
18 views

Microsoft SQL Command for Table Information (Data Dictionary)

I was wondering if someone knew the command to get the following information out of a specific Microsoft SQL Database: Table "ID" / Number (alpha-numeric order count), Table Name, Column ID, Column ...
0
votes
1answer
19 views

Can replicated commands be forced to follow each other in transactional replication?

We have transactional replication setup between an SQL Server 2012 box and a SQL Server 2016 box. Every half an hour the source table articles are altered by DELETE then INSERT sequence. This ...
3
votes
1answer
56 views

How is a T-SQL Trigger that only fires on real changes made?

I have a table trigger on UPDATE and INSERT that adds a row to another table. It only needs to add a row if one of four columns are changed. I tried using IF UPDATE(col) to test for changes but it ...
1
vote
1answer
56 views

Parameter Sniffing - Running query in code vs in management studio

I just had a problem at work where a stored proc, being called by some C# code, was very slow. When I ran the same stored proc with the same parameters in Management Studio, it was very fast. After a ...
0
votes
0answers
28 views

How to prevent large queries from causing timeouts? [on hold]

I'm finding that when I run a large query or a series of large queries the Page Life Expectancy drops and remains low and I soon see timeouts on other procedure calls. Is there any way to avoid this ...
-1
votes
0answers
21 views

Left join find missing relations

Table User id, name Table Connection id, user_id, active User can have multiple connections with active fields from 0 to 3 When I do left join I am getting all connection for each user. That is ...
0
votes
0answers
21 views

How to compare rows after union

I have two tables that I want to combine. I need to be able to show all DelDates that had changes from the original (record 1) being Record 1 as the first Record and Record 0 (table 2) always being ...
0
votes
0answers
20 views

DBCC Command Not being run by current user

I have a stored Proc that runs a DBCC command CHECKIDENT The sproc is being run by a user with adequate permissions. however, it is failing on the DBCC command with the error. User 'DifferentUser' ...
0
votes
1answer
8 views

SSIS: Conditional operator in expression builder ignores previous text

Consider the following simple expression in SQL Server SSIS, where a variable is built with the following expression containing a conditional operator: "Preamble " + @[$Package::myParameter] == "" ? ...
0
votes
1answer
55 views

Rusty SQL = Heavily scratched head

I am trying to figure out the best way to sort this solution. I am trying to produce a SP (or series) to generate invoices so that the contractors know how much they will be paid. I have created two ...
0
votes
0answers
17 views

Finding matching sub values?

So not too sure how to go about this, but ideally I want to pull out matching & non-matching info from an array of rows in a table, so I have a table with info like this: 12,2019-07-15 06:02:52,...
0
votes
1answer
36 views

Sorting issue in EXEC sp_executesql

I have follow code and after I ran them in SQL Server Management Studio, I expect to get same results because those 3 parts created exact same SQL Statement. Part 3 SQL statement is created by part 1. ...
0
votes
1answer
15 views

Consequences of cascade drop on sequences/functions/views

I am migrating some data to another server while dropping all sequences/functions/views. When I try to do simply DROP VIEW | SEQUENCE | FUNCTION | AGGREGATE without CASCADE, errors are thrown to ...
0
votes
1answer
50 views

How can I combine these three queries into one result?

I'm still pretty new at SQL, so I apologize if this is a silly question. I took existing queries for three data points, and I'm not sure how to streamline them into a single output. Clunky query: ...
0
votes
1answer
16 views

Mark duplicate records on table

i've wrote the below query to update all rows as duplicate apart from the first one. I am getting an error with the aliases. Can somebody help? UPDATE `table` SET `table`.`statuscode` = '...
0
votes
1answer
10 views

Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file

Full error Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file InvalidArgumentException: There was a problem connecting to ...

15 30 50 per page