All Questions
18,472
questions with no upvoted or accepted answers
16
votes
0
answers
4k
views
PostgreSQL trigram GIST vs. GIN indexes
I have a PostgreSQL 9.1 database that contains 10M+ rows and some text fields that need similarity and %word%-like searches, so I decided to use trigram indexes.
Initially, I started to use GIN ...
13
votes
1
answer
1k
views
MySQL deadlock: upsert query acquiring gap lock twice?
I am trying to debug a deadlock scenario which has been puzzling me for quite some time now. I am wondering if someone can shed any light into how this can happen.
Here is the deadlock output:
------...
12
votes
1
answer
16k
views
Conceptual data model for a billing system
I am working on an existing MySQL database. My task is to create a new data model for a billing system on that existing application.
I have created a conceptual data model (click to enlarge):
##...
11
votes
0
answers
7k
views
How to backup some selected tables, but not all, in pgAdmin 4?
In pgAdmin 3, the dialog to perform a backup allowed you to check and un-check the tables you wanted to be part of your backup.
In pgAdmin 4, either I am unable to find this feature, or it is not ...
11
votes
1
answer
8k
views
DBeaver launch script from file
I'm trying to find a good alternative to SQL Developer for performing queries and scripts on Oracle instances.
I find DBeaver to be an interesting tool, it has a lot of great features, BUT it seems ...
10
votes
1
answer
1k
views
Convert query in words to relational algebra
I have a follow-up question to a question I have previously asked on SO.
Instead of the query from my initial question, I want to convert the following into relational algebra:
List the names and ...
10
votes
1
answer
804
views
SSMS 2014 (and 2012) CTRL+TAB requires pressing enter
Sometime last week my CTRL+TAB behavior changed. I used to hit CTRL+TAB, release, then I would be in my previous document tab. Now I hit CTRL+TAB, release, and the nav window is still open requiring ...
9
votes
0
answers
4k
views
Working on a decision tree database design
I'm doing the conceptual model for a Decision tree database. The goal is store any Decision tree.
I have four entity types: DecisionTree, Node, Branch and Leaf.
Each Decision tree is composed of ...
9
votes
0
answers
974
views
Extended Events - sqlserver.process_login_finish Not Firing?
We're trying to see whether a client is able to reach a database server, as it's receiving error:
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or
access denied.
The error ...
9
votes
0
answers
669
views
Inconsistent equality checking of Unicode text in Postgres 9.5?
Using PostgreSQL 9.5. It seems like Postgres is being inconsistent with how it compares strings similar to لى. A unique constraint is considering some strings equal that GROUP BY is considering ...
9
votes
1
answer
1k
views
Oracle Ref Partitioning: Deadlock due to child table row migration
My ordering application uses Oracle 11g Database. This DB has a primary table ORDERS and multiple child tables like ORDER_DETAILS, PLAN etc.
ORDERS table is LIST partitioned on STATUS column and all ...
9
votes
1
answer
2k
views
Change Tracking across several Tables
I'm looking into providing DB level change tracking within my system. I need to be able to track changes at an entity level, rather than just individual tables.
Right now, we have triggers on each of ...
9
votes
2
answers
3k
views
verify that mongos server is connected to config servers
I've been writing a backup script for sharded replica-sets and it's almost done. Except I can't seem to get it to successfully start the balancer backup after everything's all said and done.
Here's ...
9
votes
2
answers
48k
views
The INSERT/UPDATE/DELETE permission was denied on the object 'TheTable', database 'TheDb', schema 'dbo'
I have two SQL Server user accounts on a database that behave differently on INSERT / UPDATE / DELETE. SQL Server version is 2008 R2 (10.50.4042, 64 bits).
UserA (SQL Login): can do these commands (on ...
9
votes
1
answer
1k
views
Postgresql with just index storage
I have a PostgreSQL table with a key (bigint) and a value (double). The table has tens of billions of rows. I have a single btree on the (key,value) for aid lookups by key. The table is never updated.
...
9
votes
1
answer
1k
views
Select * from statement execute very slowly, innodb io read speed is low
I have a very simple query " select * from ap_statistic " running in my servers. the servers have the same hardware and software configuration (CPU 8 core, mem :32G, OS: redhat 5.5, mysql version: 5....
9
votes
1
answer
1k
views
Database Stuck 'In Recovery' with command XTP_DB_RECOVERY
We recently converted a table to memory optimized data. Our backups have all ballooned (3x300GB files to 3x600GB files for Full, 3x50GB to 3x250GB for Diffs), and startup has been getting ...
8
votes
1
answer
126
views
Why does only one version of these procedures get blocked under moderate load?
The table:
CREATE TABLE [dbo].[Session] (
[SessionId] UNIQUEIDENTIFIER NOT NULL,
[CID] INT NULL,
[DEST] VARCHAR (50) NOT NULL,
[...
8
votes
0
answers
986
views
SQL Server 2012+ & Service Broker: SSBDT Spam ending conversations after sending message to NULL conversation_handle
I'm mostly posting this for community awareness, but feel free to give feedback if you think there is a solution other than coding around the problem as we are doing. Crossposting this from my bug ...
8
votes
0
answers
2k
views
AWS RDS postrgres massive disk use, small tables
I can't figure out why our AWS postgres server has consumed all of it's space. We just had to up the storage space allocated to it, but can't find any hint from postgres that it's using that much ...
8
votes
0
answers
2k
views
How to measure the memory usage of a Mongodb aggregation?
I recently started running into the Sort exceeded memory limit of... exception on an aggregation pipeline in MongoDB. I got around this by setting AllowDiskUse=True for the aggregation. However, I ...
8
votes
1
answer
3k
views
SQLPackage : Import or Export SQL Azure BACPAC without users
I know how to use SQLpackage.exe. I can export from SQL Azure and create a bacpac. I can also Import to SQL Server via SQLPackage.exe.
I want to export or import without the users in the database. The ...
8
votes
0
answers
850
views
How to minimize access exclusive table locks while reducing bloat or ALTER (ing) a table?
In some circumstances, I've been told not to do a VACUUM FULL (or CLUSTER) of a table that is in production, because that will exclusively lock it for longer than wished. The same might apply to ...
8
votes
0
answers
14k
views
Generate UUID v4 automatically in MySQL
Is it possible to generate a UUID version 4 (completely random) in MySQL? I would like to use it as a primary key.
Use Case
Many systems will insert to the table, some may specify a UUID when ...
8
votes
1
answer
2k
views
MySQL: Is the read committed isolation level safe with mixed binary log format?
When using the MIXED format with the READ COMMITTED isolation level, am I safe?
The docs state (http://dev.mysql.com/doc/refman/5.5/en/set-transaction.html#isolevel_read-committed)
If you use READ ...
8
votes
1
answer
3k
views
MySQL query to create a Matrix view using pivot
I have a table with the following fields:
p1
p2
s1
s2
where p1 -> player1, p2 -> player2, s1 -> game1, s2 -> game2
The number of players can vary from 3 - 10.
The table have the results between them....
8
votes
1
answer
125
views
Does MySQL/InnoDB use table caches when dealing with foreign tables?
TL;DR: Does a table referred to via schema.table get held in table cache?
I have a large number of client databases that our application connects to based on an http request. These are used for every ...
8
votes
1
answer
2k
views
Receiving error when running DBCC CheckDB - multiple IAM pages
Running DBCC CHECKDB (dbname) WITH NO_INFOMSGS, ALL_ERRORMSGS results in this error:
Table error:
Multiple IAM pages for object ID 813245952, index ID 1,
partition ID 72057594073972736, ...
8
votes
1
answer
1k
views
RDS MYSQL instance rebooted and won't load INNODB table
So my production db in RDS apparently either crashed or was rebooted during a version update, and upon being restarted mysql couldn't load one of the innodb tables: as evidenced by the following error ...
8
votes
1
answer
2k
views
Service Broker: Queue Monitor is dropped after poison message
I have searched everywhere and there isn't an answer online. There is one similar question on stackoverflow but it's not exactly the same and it has no accepted answer.
When I setup event ...
8
votes
2
answers
120
views
Changes access method for non-correlated subquery
Oracle 11g R2
Unfortunately our application has per row security "features".
We have a query that looks about like this:
Bad, slow:
SELECT someRow, someOtherRow
FROM bigTableA a
WHERE EXISTS (
...
7
votes
1
answer
8k
views
How to estimate reindexing time?
How do you estimate the total time reindexing an entire table will take in PostgreSQL?
I have a large PostgreSQL database, the primary table of which has 15 million rows with 100 columns and 200 ...
7
votes
0
answers
133
views
Find a previous statement or held locks in a blocking situation
I'm using XE blocked_process_report to detect and analyse the blocking.
But since it's a point-in-time situation, I only see the blocking leader's statement currently being run and the incompatible ...
7
votes
0
answers
2k
views
pg_restore --clean not working because cascade drop
I'm working with a copy (DB-B) of a database (DB-A) I keep up to date by running daily:
pg_restore -U postgres -d someDB --clean -j 2 -L WhatToImportList admin.dump
But I started noticing duplicate ...
7
votes
1
answer
250
views
Do any of the graph based/aware databases have good mechanisms for maintaining referential integrity?
Do any of the graph-based/graph-aware databases (Neo4j, ArangoDB, OrientDB, or other) have mechanisms for maintaining referential integrity on a par with those offered by relational databases?
I'm ...
7
votes
1
answer
12k
views
Restore mongoDB by --repair and WiredTiger
We accidentally deleted the directory rm -rf /data/db
which was our MongoDB path, and thanks to
extundelete, we recovered it and got the directory /data/db.
Here are our files in the directory, and ...
7
votes
0
answers
73
views
Authoritative Extend Event object list?
I am looking for an authoritative list of objects for extended events, I want to know what version an object becomes available and some clues about what the value really represents. I have googled ...
7
votes
0
answers
3k
views
How do I rename a table with minimal downtime in a production postgres database?
I understand that renaming a table in postgres boils down to a simple catalog update. However, it also requires an ACCESS EXCLUSIVE lock to ensure transactions are safe.
What would be the ideal way ...
7
votes
0
answers
1k
views
Can a BRIN index be used instead of Table Partitioning in Postgres?
Given an append only table with a GUID and a timestamp (and a bunch of other columns) which can grow by ~50Mio entries / year. I want to keep the number of indices low and just use a normal (B-Tree) ...
6
votes
0
answers
131
views
Right way to set up a secondary citus worker
I am experimenting with the postgres-addon citus.
So far I have setup a cluster with one coordinator and three worker nodes.
Now I want to setup a secondary for one of the worker nodes.
So far I have ...
6
votes
0
answers
587
views
What are PostgreSQL Security Labels?
What are PostgreSQL Security Labels and how/where to use them compared to GRANT?
6
votes
0
answers
242
views
Using the Schema Generation Wizard to regenerate a previously-generated schema
Lately, I've been trying to clean up a group of projects that my company received from an outside contractor. Among them is an SSAS cube, with an associated data warehouse.
The contractors generated ...
6
votes
0
answers
6k
views
Getting "Cannot open datafile for read-only" for an intentionally DROPped InnoDB table
It's been too long to remember how we got here accurately, but we get the following error on MySQL start (though it does still start the service with InnoDB):
[ERROR] InnoDB: Cannot open datafile for ...
6
votes
0
answers
434
views
UUID V1 and V4 bloats substantially after sequntial inserts and deletes. Why is it so, compared to serial and temporal BTree (which does not bloat)?
I am trying to understand the impact of deletions to bloat of tables and indexes after large number of inserts and deletes. The inserts and deletes are following a rather strict pattern: first the ...
6
votes
0
answers
1k
views
MongoDB background index builds block secondary
We recently experienced a disruptive incident in a MongoDB 3.2 cluster related to index creation. Scenario:
Several indexes were created on the primary using background: true.
Indexes were ...
6
votes
1
answer
8k
views
How to add `--sslAllowInvalidCertificates` on mongodb uri?
I have a mongodb server requires x.509 certificate. So I have to use --sslPEMKeyFile and --sslCAFile on mongo shell command to connect to that server. It works fine. In my dev environment, I am using -...
6
votes
1
answer
2k
views
Unable to get rid of orphan temporary tables
After migrating from MariaDB 5.5 to 10.0, I noticed an error message mentioning a table named piwik/#sql-1526_3a.
From there I started googling and landed on the innodb troubleshooting docs
Indeed, ...
6
votes
0
answers
5k
views
AWS RDS Postgres Logical replication
I am using AWS RDS Postgres's and RDS's logical replication support
(Edit: Note, this is not the same as the logical replication featurein PostgreSQL 10. It's AWS RDS functionality based on the same ...
6
votes
0
answers
656
views
CHANGE_TRACKING_CURRENT_VERSION() incorrect on database in standby
We are using a change tracking solution to export increments for BI purposes for years now. But it was running directly on the production database. To lower the load on the system we wanted it to run ...
6
votes
1
answer
1k
views
Postgresql: How to avoid encoding issues when copying a schema from one server to another?
I'm using pg_dump and pg_restore to move a schema from one Postgresql 9.5 server to another. On the destination server:
$ pg_dump -h source.example.com -n my_schema -v --no-owner -F c -f my_schema....