All Questions

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

How to get attendance with Multiple Record

I have this attendance with multiple record. i can't get the attendance with too much record how do i remove the unusable attendance ? id user_id verify_date verify_type verify_state ...
0
votes
1answer
914 views

Mongo: Not authorized to do anything after enabling service on boot

I have been using MLab and MongoAtlas successfully for a project I'm working on. Now I'm trying to migrate the DB to local storage so that the software can write and store data without needing ...
0
votes
1answer
22 views

How to DELETE from a large table?

I want to merge two large tables. The ideal approach is to INSERT entire table1 and then DROP it. But table1>1TB and my disk is 2TB. Therefore, I have to delete from table1 while INSERTing into table2....
8
votes
2answers
229 views

Why does this seek on BIGINT col have extra constant scan, compute scalar, and nested loops operators?

When I look at the actual exection plan of some of my queries I notice that literal constants used in a WHERE clause show up as a nested chain of calculate scalar and constant scan. To reproduce this,...
0
votes
0answers
8 views

What should my database design look like if I want to implement an invoice preset?

I just finished creating the invoice part of my database and now I need to implement an invoice preset feature wherein it basically takes different products and services, both main and sub and puts ...
0
votes
1answer
231 views

Row-row based logging in a blackhole replication filter setup?

I am using two MySQL server instances on the same server to filter replication to a third external server. My filter slave is using the blackhole engine as described here: https://dev.mysql.com/doc/...
-1
votes
0answers
12 views

Follow up to multiple result tabs in Workbench

@Mike Lischke -- this is in response to your reply to my question here regarding multiple result tabs (Multiple Result Tabs in Workbench) This is a screenshot of the tutorial I am viewing to teach ...
0
votes
1answer
23 views

Unable to create cluster with repmgr for postgrSQL

I follow this guide to setup. https://medium.com/@victor.boissiere/how-to-setup-postgresql-cluster-with-repmgr-febc2f10c243 Everythings going fine but when come to here sudo -i -u repmgr rm -rf /...
3
votes
2answers
120 views

How do I prevent my clients viewing my database definition when it is installed on their server?

I want to give my database to the client to install on their server. However, I want to deny the client rights to see the tables and stored procedures and also want to restrict that database to run ...
0
votes
1answer
30 views

Prevent compilation of a stored procedure to a linked server

I have a stored procedure, that queries a view on a linked server. This works fine on prod, but our development server has some firewall restrictions, that prevent the compilation. This is no problem ...
0
votes
1answer
14 views

#1005 - Can't create table `fasflixdbp5`.`employee` (errno: 150 “Foreign key constraint is incorrectly formed”) error with employee table

DROP TABLE IF EXISTS Trans; DROP TABLE IF EXISTS Location; DROP TABLE IF EXISTS Employee; DROP TABLE IF EXISTS Movie; DROP TABLE IF EXISTS VideoGame; DROP TABLE IF EXISTS Customer; DROP TABLE IF ...
-1
votes
1answer
241 views

can't increase gcache.size galera cluster mariadb

i wanted to increase the value of gcache.size on my 3 nodes of the mariadb galera cluster (galera v25.3.22(r3764), mariadb Ver 15.1 Distrib 10.0.33 - MariaDB, for Linux (x86_64) using readline 5.1), ...
0
votes
3answers
39 views

How to change the default output format for boolean values

In a Postgres database, I know how to use case statements to get only TRUE or FALSE for a boolean field but was wondering whether there is a cleaner way to set this up like changing any configuration ...
2
votes
1answer
57 views

Understanding repeatable read isolation level

Wikipedia defines following terms: With a lock-based concurrency control DBMS implementation, serializability isolation level requires read and write locks (acquired on selected data) to be ...
15
votes
3answers
19k views

why pg_restore ignores --create ? Error: failed: FATAL: database “new_db” does not exist

I am trying to run following command: sshpass -p "pass" ssh x@1.2.3.4 "pg_dump -Fc -U foo some_db" | pg_restore --create --dbname=new_db I get: failed: FATAL: database "new_db" does not exist
0
votes
0answers
7 views

Pgpool load balance to multiple read replica

I have one postgresql master and it has 4 read replica(CloudSQL). I want to setup a load balancer for the read replica. But unfortunately we can't do this since its a managed one. So Im thinking ...
0
votes
1answer
887 views

mongodb set feature compatibility to 3.4 fail

I want to enable the features of my Mongodb 3.4 after upgrading. I have sharded cluster enviroment And after I ran the commands: use admin db.adminCommand ({setFeatureCompatibilityVersion: "3.4"}) ...
0
votes
1answer
30 views

Multiple Result Tabs in Workbench

I have several queries in the editor, each terminating with a semi-colon (I am teaching myself SQL and so in the editor is a mix of queries and notes like below): SELECT * FROM orders WHERE ...
-1
votes
1answer
192 views

How to group rows based on it's ordering and limiting rows count in group?

Sample data: id type 1 0 2 1 3 0 4 1 5 0 6 1 7 0 10 1 11 1 12 1 13 1 15 1 Expected result after grouping, if max rows count in group is 3, and we can merge rows with same type in range 2 ...
0
votes
0answers
11 views

Automating database restoration of SQL Server transaction log files on standby mode

I am wondering if I get help from this house on the following issue. I have a standby database that should be restored with the set of transaction log files I get from the vendor's(eClincalWorks) ...
1
vote
3answers
3k views

You do not have privileges to manipulate with the users!

Error message: You do not have privileges to manipulate with the users! Appears in PhpMyAdmin using Mariadb 10.3.7 on MacOs High Sierra installation from Homebrew I'm logged in as root installed ...
0
votes
1answer
14 views

Migrate legacy application to new db/schema

I apologize if I made any mistake/missing info, fist post here! I am in the process of rewriting a website from scratch to a newer tech stack with a completely redesigned architecture. The website in ...
1
vote
1answer
137 views

MySQL on idle low-end server unresponsive

I have a small virtual Server: 2 Cores, 2 GB RAM, Windows Server 2012 R2, Plesk, MySQL 5.6 (my.ini see below). Pagefile is disabled. Taskmanager says 1,3 GB RAM used. Only a single Wordpress ...
14
votes
4answers
50k views

Taking MySQL dump from another machine

I have a MySQL db on Machine A and I want to access the mysqldump from machine B. Both machines are running on Linux and I also have the credentials of both, but I can't access the mysqldump. What ...
0
votes
3answers
2k views

Disable Binary Logs in MySQL 8.0

How can I disable binary logging on MySQL 8.0? I am needing to import a large MySQLDump file, and don't want to fill the Binary logs with many GB of data. In the past I would have set log_bin=0 in ...
0
votes
3answers
2k views

sqlplus SP2-0341 (line overflow during variable substitution)

I want to export an Oracle database to a file and i'm using SQLDeveloper on Windows for that (the resulting SQL text file is about 35MB). This results in very long lines. I hit a snag when importing ...
0
votes
1answer
17 views

Do table locks get released after a query finishes when WAITFOR is used after that query within the same batch and transaction?

If I have a query that reads from a table, if that query is proceeded with the WAITFOR keyword (within the same batch and transaction) will the table lock of the preceding query be held until the ...
1
vote
3answers
40 views

Having md5(NULL) return a non-NULL value in postgresql

I have a table with the structure (content_md5 UUID, content TEXT), where I'd like to use content_md5 (which is the value of md5(content)) as the primary key, and use it as a foreign key in other ...
-1
votes
0answers
12 views

Duplicated question! Need help to delete it?

Did I normalize it correctly? PLEASE DOWNVOTE THIS QUESTION TO MAKE IT GONE !!
1
vote
1answer
25 views

Does a UNIQUE constraint implicity contain the primary key?

I'm aware that INNODB includes an implicit primary key in an index such as: INDEX (non_primary_column) Does it apply to the UNIQUE constraint too? UNIQUE (other_primary_column) -- equivalent to ...
4
votes
1answer
97 views

If a stored procedure is altered while it's currently being used in a cursor, does the cursor continue using the old query before it was altered?

If a stored procedure (or view) is currently in use within a long running cursor, and I alter that stored procedure, will the cursor continue using the old instance of the stored procedure until the ...
-1
votes
2answers
23 views

Mysql Stored Procedure is not incrementing LAST_INSERT_ID() on insert to next table

CREATE DEFINER=`root`@`localhost` PROCEDURE `Migrate`() BEGIN DECLARE new_id INT; START TRANSACTION; INSERT INTO new_customers(firstname, lastname) SELECT firstname,...
3
votes
0answers
35 views

How to set up a solid MySQL/MariaDB Server for +3000 active connections? [on hold]

Background. I have an App connecting to an RDS instance on Amazon (r3.Large) and it's working smoothly. However, the boss does not like to spend ~ $1,000 bucks a month on it so we are moving In-house....
0
votes
1answer
16 views

Different default innodb_buffer_pool_size on Windows with MySQL 8.0.18

I have installed MySQL 8.0.18 Community with the same configuration (mysql-installer-community-8.0.18.0.msi installer, custom install with server + workbench, standalone server, legacy authentication, ...
25
votes
2answers
14k views

Using MongoDB and PostgreSQL together

My current project is essentially a run of the mill document management system. That said, there are some wrinkles (surprise, surprise). While some of the wrinkles are fairly specific to the project,...
-1
votes
1answer
21 views

Pulling the MINIMUM Date

I'm trying to join two tables together, that only share an "Account Number" as a joining field between them. One table (Table1) is static and contains just one record per account number, but the ...
-1
votes
1answer
10 views

Dividing two column values based on another column value

I have a query that returns the following structure: start_date | pid | uid | type | total 2019-11-10 | 2006933595591018006 | 1812803885757105697 | recommended |...
11
votes
1answer
2k views

Estimated versus actual query plan with function calls

I have this query on SQL server, a merge replication query: SELECT DISTINCT b.tablenick, b.rowguid, c.generation, sys.fn_MSgeneration_downloadonly ( c.generation, ...
12
votes
1answer
7k views

Why SQL Server doesn't support foreign key constraints on views?

I know that SQL Server doesn't support using a view as the reference for a foreign key constraint, is there a reason (i.e. something to do with the relational model) this is the case? It seems like ...
6
votes
1answer
907 views

DBCC TRACEON (652) does not disable read ahead reads

Refering to this StackOverflow question: https://stackoverflow.com/questions/13307485/sql-server-clearing-cache-has-no-effect-on-io-stats I used the trace flag 652 which had, at the time disabled the ...
24
votes
1answer
9k views

Execution plan shows expensive CONVERT_IMPLICIT operation. Can I fix this with indexing or do I need to change the table?

I have a really important, really slow view which includes some really ugly conditions like this in its where clause. I am also aware that the joins are gross and slow joins on varchar(13) instead of ...
0
votes
0answers
16 views

Nullable smallint column usage in a CASE Statement nested in a STUFF function

I'm having issues writing a Stored Procedure that uses a CASE statement inside of a STUFF function. I thought my issue may have to do with Restricted being a nullable smallint. I tried converting it (...
2
votes
1answer
172 views

SQL PROFILER Replay statistics event interpretation

I tried capturing a replayable trace on a SQL Server 2012 production environment and then replay it against a SQL 2016 test environment. After doing so , I got the following results : Can anyone ...
-1
votes
1answer
20 views

How can PostgreSQL use multi-column index for column-specific lookups?

If I'm reading this article correctly, one can create an index on t(col1, col2) and use it to speed up lookups for col1. Storage and CPU-wise, I assume that having such a combined index is more ...
1
vote
1answer
21 views

Numeric data-type for integers

I need to store exact sums of bigint columns in a summary table. So I must use data type numeric for those columns. Now I am wondering if setting the scale to 0 in this case makes sense (e.g. maybe ...
0
votes
1answer
86 views

Mongo replication sync to newer version

I got one mongo v2.4.10 server with 1.7TB data, I am trying to migrate and upgrade the mongo to mongo v.3.0.15 server I've setup a new mongo v.3.0.15 and configured replication for v3.0.15 to be ...
0
votes
0answers
25 views

How to query nested fields in MongoDB using Presto

I'm setting up a Presto cluster which I'd like to use to query a MongoDB instance. Data in my Mongo instance has the following structure: { _id: <value> somefield: <value> ...
4
votes
1answer
578 views

GZip existing varbinary(max) column in Sql Server 2008+

I have an existing legacy table that is ~180GB in size due to a client application storing PDF files as varbinary. I'd like to be able to compress that column for all rows using GZIP to help save ...
14
votes
2answers
10k views

Alternative way to compress NVARCHAR(MAX)?

I am trying to compress some tables that have NVARCHAR(MAX) fields. Unfortunately, the row and the page compression do not have the desire impact (only ~100/200 MB saved for 20 GB table). Also, I am ...
0
votes
2answers
47 views

Variables in Oracle Triggers

Context Every few weeks the database guy at work backs up the production database and then several weeks later imports it into the development database. I don't know why it takes so long between ...

15 30 50 per page