All Questions

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

How to Diagnose Weatherreport from CouchDB

After building CouchDB from github. I run weatherreport as recommended in documentation to get the following error. How do you diagnose exactly whats going wrong? This seems like a bunch of random ...
0
votes
0answers
3 views

Teradata Large Table Partitioning or Split into multiple parts

We have a large table (4 Terabytes) in Teradata. For compliance reasons, we need to keep 13 months worth of data. However, for querying, we may only need one month worth of data (300GB). I have ...
1
vote
1answer
10 views

How to check if int[] array contains a value less than X?

We can check if a specific value is contained in an array using 'X' = ANY(haystack). However, how do I check if an array of integers contains a value that is less than X?, e.g. I want to find all ...
0
votes
0answers
6 views

Normalization and Denormalization MongoDB | Schema Question Follow System

I'm breaking my head over this: The User on my WebApp can follow a Tag (Like a user can follow a subreddit), the followed Tag will be shown in the Homepage with a different color than the not followed ...
0
votes
1answer
19 views

Subquery not using Index, even if forcing

Using MariaDB 10.5.12 on CentOS 7 If it makes any difference, my "optimizer_use_condition_selectivity" = 1 If I run: EXPLAIN SELECT COUNT(*) FROM ips WHERE ip="1.2.3.4" This query ...
0
votes
1answer
29 views

Unused Indexes - How Few Is Too Few?

When looking at seeks, scans and updates for indexes in SQL Server, what's a good rule of thumb for determining whether an index is 'unused enough' to be dropped? Maybe some ratio of updates to seeks ...
-1
votes
1answer
41 views

How can I prove / disprove If A ↠ B then AC ↠ B

If A ↠ B then AC ↠ B is it true or false and if so can have example why?
1
vote
1answer
17 views

How to make mysql trigger to access another table's entry?

Say there is a DB with 3 tables Books table - contain book_id and its title Inventory - A list of book_ids in the inventory Logs - A list of log strings. Every time I add a new book_id to the ...
0
votes
2answers
17 views

Postgresql pg_toast tables, are they mandatory?

I have a small schema in PostgreSQL v13 with only schema structure and still no data. What I have seen, that I got some pg_toast tables for normal tables although there is no data inside. I have a ...
0
votes
0answers
8 views

SSRS - Cannot deploy a report (timeout, fixed by renaming the file from 37 to 28 characters long)

Edit: I have discovered I can deploy the file if I rename it to be shorter. The file name is 37 characters long. The path is 47 characters long, including the http prefix, server name and folder ...
0
votes
0answers
21 views

Delay in prelogin response when connecting to Azure SQL

I have set up a linked server to an Azure SQL 2014 managed instance. The vendor gave me a SQL login and password to use. I can open a direct connection in SSMS and run queries. But when I try to run ...
1
vote
1answer
18 views

What does running "show slave status" on a master server show?

We are using monitoring software that is throwing an error saying that Slave_IO_Running is returning No for replication on our master server. It is in fact true that when running show slave status on ...
1
vote
2answers
18 views

How to get the second highest value per group?

Getting the second highest value from a table has been solved many times, but I'm looking for the second highest value in each group. Given this table: +----+-----+ | A | 10 | | A | 20 | | A | ...
-1
votes
0answers
10 views

How to backup a live database especifically Postgres

I have production Postgres database that is running remotely and I want to backup the live database without stopping it. I don't want to use pg_dump as it takes too long and not really reliable. Tried ...
0
votes
1answer
13 views

CockroachDB upgrade not finalized

I am running a three-node CockroachDB docker cluster (Debian OS) and I recently upgraded the cluster from version v21.1 to version v21.2 following the procedure outlined in the documentation using the ...
0
votes
2answers
31 views

Postgresql query optimisation with left join

I'm trying to optimize query run on Postgresql 12. There are 2 tables users (5 mln rows) grants (8 mln rows) I'm running a following query SELECT * FROM users u LEFT JOIN grants g ON u.id = g....
1
vote
0answers
30 views

Why Isn't the MySQL Index Immediately Available?

We are in the process of moving from AWS RDS MySQL 5 to AWS RDS MySQL 8. We have a script that runs a few dozen queries. The last few look like this: ALTER TABLE my_right_table ADD INDEX (col_a, col_b)...
0
votes
1answer
25 views

How i can use the function encrypt in one consult update

I'm trying to duplicate a column, but I would like to encrypt it with not very high data value, and I was able to do it, well, just the first part. CREATE TABLE probeta ( id int primary key, ...
-1
votes
0answers
27 views

What does the sql code look like to count the amount of matches between two tables

I have two tables (USER1 and USER2) they each contain a user's email, first and last name, interest department and project ID I have the following questions: 1.) What would the sql code look like to ...
0
votes
1answer
20 views

Compare today's and yesterday's data in MySQL

I have the following table: location eventdate value loc1 2021-11-28 1 loc2 2021-11-28 2 loc1 2021-11-29 1 loc2 2021-11-29 3 loc1 2021-11-30 2 loc2 2021-11-30 5 And I'd like to compare the ...
2
votes
1answer
55 views

Why is FROM VALUES massively faster than visiting a table once?

Given this setup, CREATE TABLE t(foo) AS SELECT 'foobar'::text; Why is this query, EXPLAIN (ANALYZE, TIMING OFF) SELECT generate_series(1, 1000000), upper(foo) FROM ( VALUES ('foobar') ) AS t(foo)...
-1
votes
1answer
40 views

Timestamp to indicate the latest event writing in a table [duplicate]

I want to know if there is any way to find out when the latest event was writing to a table in SQL Server. Assuming the table does not have a created_at/updated_at columns and CDC and Change Capture ...
0
votes
0answers
6 views

Google Cloud SQL - Database instance storage size increased dramatically everyday

I have a database instance (MySQL 8) on Google Cloud and since 20 days ago, the instance's storage usage just keep increasing (approx 2Gb every single day!). But I couldn't find out why. What I have ...
0
votes
0answers
19 views

postgresql performance issue with multiple EXISTS

explain select count(*) from (SELECT tcy.clientid, tcy.projectid, max(tcy.lastmodifieddate) AS projectupdatedat FROM test_cycles tcy JOIN projects ...
1
vote
1answer
61 views

Unable to restrict user from built in SQL Server Functions

We have a SQL Server (Standard) database with a user whom we are attempting to restrict permissions to only CRUD Operations to certain tables (CREATE, SELECT, UPDATE, DELETE) and only allow connect ...
-1
votes
0answers
29 views

Timestamp to indicate the latest event writing in a table [duplicate]

I want to know if there is any way to find out when the latest event was writing to a table in SQL Server. Assuming the table does not have a created_at/updated_at columns and CDC and Change Capture ...
0
votes
1answer
6 views

problem installing mariadb using mysql_secure_installation

I started secure install of MySQL with sudo mysql_secure_installation command, and I got that message: Securing the MySQL server deployment. Enter password for user root: Error: Can't connect to ...
0
votes
0answers
10 views

Getting the max ID of integer columns in databases in Postgres 9.6/12

I am looking to get the max ID of each integer column in our databases servers. The function I currently use: CREATE OR REPLACE FUNCTION intpkmax() RETURNS TABLE(schema_name name, table_name name, ...
0
votes
0answers
25 views

Database Design With Multiple Payment Methods And Membership Types

I want to design my database similarly to something like this: https://stackoverflow.com/questions/57510457/better-way-to-design-payment-database-with-multiple-payment-methods But my database is a ...
0
votes
0answers
34 views

Database Design With Multiple Payment Methods And Membership Types

I want to design my database similarly to something like this: Better way to design payment database with multiple payment methods But my database is a little more complex where instead of buying 1 ...
-1
votes
0answers
16 views

Is there a name for a relation with FDs whose LHS includes part or whole of the primary key and some other attributes?

Take a relation like R(A,B,C,D) with the following FDs: AB -> C BC -> D The primary key of the relation is AB because AB -> ABCD holds. However I can't determine in what way D is dependent on ...
0
votes
2answers
18 views

ERD - How to add an attribute to one side of the recursive relation?

The simplified scenario for the ERD A company has employees (each has unique id emp_id) Each employee is supervised by another employee A supervising employee has a special attribute SID Here is my ...
0
votes
0answers
4 views

paritition exchange without validation mysql 8

I have a table in production facing about 1M inserts per day,partitioned on a date column. This table is queried as well but the inserts are important for application. Have a small script that runs ...
0
votes
1answer
13 views

Should I design my firestore database with different collections for each userId or one collection for all userIds?

I have a Firestore db where I have setup the structure: registrations/[userId]/symptoms/[documentId]/[some kind of document] I did like this because the user should only read its own symptoms, and ...
4
votes
3answers
484 views

How can you replace the last occurrence of a character in a string (text column)?

Let's say I have a text field with this value in Postgres: 'bar$foo$john$doe$xxx' I'd like to replace just the last occurrence of the dollar ($) character with another character, for example '-'. ...
0
votes
0answers
24 views

emails sent by a phantom job: find a sender job

Every night at the same time I receive some mails like that: DESCRIPTION: Error: 50000 Severity: 16 State: 1 [ERROR]:DWHDumpProcess_XXX job is either failed or not in good state. Please check. Return ...
0
votes
1answer
9 views

Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='

After I changed both table collition into utf8mb4_unicode_ci, the database still show this error: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for ...
0
votes
1answer
20 views

Postgres list only user's database and keep other hidden?

I've created a postgres user 'tester' and allowed to readonly to a database A. This user has no permisssion on database B & C. But when I do \l to list database. The database B and C are also ...
0
votes
0answers
29 views

MariaDB replication error 1236: 'Could not find first log file name in binary log index file'

I received an error during MariaDB replication that I'm not sure how to fix. Replication is a new topic to me and I acquired these databases and their architecture through a job, so I've done some ...
0
votes
2answers
29 views

How to make a restricted view in oracle?

I had to provide data for an application schema, but there is a requirement that the applications connecting using that schema user cannot query more than five rows at a time, the application queries ...
0
votes
0answers
13 views

Connection to AWS database gives back "You may not specify an IPv4 CIDR for an existing referenced group id rule."

I try to connect to a AWS database instance from a client by following this tutorial: https://medium.com/simplebackups/allow-a-remote-ip-to-connect-to-your-amazon-rds-mysql-instance-2d5074d601eb I ...
0
votes
0answers
5 views

barman installation as non root - do I have to adjust PATH manually, or should that be taken care of by the setup.py script?

I want to run barman without being root. So far I am aware how to achieve this (mainly discussed in this thread it works generally but I need to address the barman command specifically with .local/bin/...
1
vote
1answer
34 views

Postgres find gaps between one date range and others

My question is similar to https://stackoverflow.com/a/41267928/2585154 , but in my case I need to divide/split date range by multiple date ranges, not only one. In my case is also guaranteed that &...
0
votes
1answer
12 views

Mongo node with smaller priority has not stepped out

I have a three nodes replica and I prefer a 10.0.0.5 as a primary. I have just realized during a performance test that 10.0.0.2 is primary instead. I thought it should have step out automatically ...
1
vote
1answer
45 views

Order by one column if not null, otherwise by another column, columns are of not matching types

I have an application that uses PostgreSQL as RDBMS. There is a table containing orders placed by customers. The table has an id as primary key, an order_number (integer) and a created_at field (...
0
votes
1answer
18 views

For each tuple, get the name of the first column which is non-zero

I have a table in Hive which looks like: | Name | 1990 | 1991 | 1992 | 1993 | 1994 | | Rex | 0 | 0 | 1 | 1 | 1 | | Max | 0 | 0 | 0 | 0 | 1 | | Phil | 1 | 1 | 1 ...
0
votes
0answers
17 views

Access ForeignKey columns via dot in PostgreSQL?

I have a table user with columns id, name, email I have a table book with columns id, name, author (ForeignKey to user). Is there a way to write this SQL query in PostgreSQL? select name, author....
1
vote
2answers
46 views

Best way to store encrypted API identifiers (MariaDB)

So for max security I have to encrypt some string keys which I need to call specific actions of an API, at a very regular basis of the use of an application, so performance should also be considered. ...
0
votes
1answer
61 views

Ola Hallengren maintenance solution

When I am executing the below query: EXECUTE dbo.IndexOptimize @Databases = 'USER_DATABASES', @FragmentationLow = NULL, @FragmentationMedium = NULL, @...
0
votes
0answers
48 views

Is this database correctly structured?

I am in the process of converting a bus timetable to a database structure. I am building a free mobile app for a specific itinerary in my country that will: let users know when their next bus is due ...

15 30 50 per page
1
2 3 4 5
1867