Most Popular

1500 questions
22
votes
4 answers

Cannot shutdown old postmaster when upgrading to Postgres 9.2

I'm upgrading to Postgres 9.2.2 (from 9.1.4). When I try to upgrade the DBs using: pg_upgrade -b /usr/local/Cellar/postgresql/9.1.4/bin -B /usr/local/Cellar/postgresql/9.2.2/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres I get the…
Luciano
  • 1,771
  • 3
  • 12
  • 8
22
votes
1 answer

How soon after updating expire_logs_days param and restarting sql will old binlogs get deleted?

MySQL 5.1.x | InnoDB | Windows My mysql data directory is starting to fill up with bin logs. I currently have the following settings configured in my windows mysql server:…
Mike B
  • 617
  • 4
  • 10
  • 17
22
votes
1 answer

Does mysqldump export indices, by default?

I played around a little with mysqldump and I was wondering, if it does export indices (FULLTEXT, INDEX,...) by default. I read up on it and I found this option: --disable-keys, -K which suggests, that it actually does export the indices. But I…
Aufwind
  • 377
  • 2
  • 3
  • 8
22
votes
2 answers

What is the modern way to partition PostgreSQL across machines, when the data is "naturally partitionable"

After several years of dwelling into the "NoSQL" space, now I have a problem that is quite "relational" in its nature. Today I see data stores with quite different eyes than before. Things like Riak have spoiled me in a way that I can no more…
loxs
  • 321
  • 2
  • 5
22
votes
3 answers

Pivot rows into multiple columns

I have a SQL Server instance that has a linked server to an Oracle server. There is a table on the Oracle server called PersonOptions which contains the following data: ╔══════════╦══════════╗ ║ PersonID ║ OptionID ║ ╠══════════╬══════════╣ ║ …
ChrisLively
  • 887
  • 3
  • 10
  • 19
22
votes
1 answer

Struggling to debug high CPU usage on Amazon RDS MySQL instance

We're running an m1.xlarge MySQL RDS server and having some issues with high CPU usage. We had some problems a couple of weeks ago with CPU utilization reaching 100% on a large instance. When we upgraded the size to xlarge that stabilised things for…
WillJThomas
  • 491
  • 1
  • 3
  • 7
22
votes
1 answer

What exactly are iblog files in mysql

I would like to understand these ibdata files as these play vital role in the crash recovery procedure. I could not find proper resources over the web for this.
Uday
  • 814
  • 3
  • 13
  • 27
22
votes
1 answer

When should extended events be used instead of SQL Profiler/perfmon?

The extended events seem like a better technology and less stress on the server, but the SQL Profiler/perfmon has better tooling. Also the extended events seem to have a steeper learning curve. In which context should each be used? Is it worth…
22
votes
1 answer

In SQL Server, why can a backward scan of clustered index cannot not use parallelism?

I've been reading about SQL Server internals and every book or blog mentions this about backward scans. A backward scan of a clustered index cannot use parallelism The only post that said something is this one below. The post says that the SQL…
Kishan Dasari
  • 329
  • 1
  • 4
22
votes
4 answers

SQL Server has encountered occurences of I/O requests taking longer than 15 seconds

On Production SQL Server, we have following config: 3 Dell PowerEdge R630 servers, combined into Availability Group All 3 are connected to a single Dell SAN storage unit which is a RAID array From time to time, on PRIMARY we are seeing messages…
Aleksey Vitsko
  • 6,148
  • 5
  • 39
  • 70
22
votes
5 answers

How do I get the current and next greater value in one select?

I have a InnoDB table 'idtimes' (MySQL 5.0.22-log) with columns `id` int(11) NOT NULL, `time` int(20) NOT NULL, [...] with a compound unique key UNIQUE KEY `id_time` (`id`,`time`) so there can be multiple timestamps per id and multiple ids per…
Martin Hennings
  • 357
  • 1
  • 3
  • 9
22
votes
1 answer

CPU usage constantly high after upgrading from Postgres 9.5 to 9.6 to 10.6

I upgraded my RDS instance (db.t2.medium) from Postgres 9.5 to 9.6 couple of days back. Since the upgrade, the CPU usage was almost 100% all the time. This brought down my application. Presuming that the problem is with the 9.6 version, I did…
Raj
  • 405
  • 1
  • 4
  • 9
22
votes
4 answers

How does SQL recursion actually work?

Coming to SQL from other programming languages, the structure of a recursive query looks rather odd. Walk through it step by step, and it seems to fall apart. Consider the following simple example: CREATE TABLE #NUMS (N BIGINT); INSERT INTO…
UnLogicGuys
  • 409
  • 4
  • 11
22
votes
3 answers

How can I generate a random bytea

I would like to be able to generate random bytea fields of arbitrary length (<1Gb) for populating test data. What is the best way of doing this?
Jack Douglas
  • 40,517
  • 16
  • 106
  • 178
22
votes
4 answers

CREATE FILE encountered operating system error 5 (Access is denied.)

I'm trying to execute the following script in SQL Server Management Studio: USE [master] GO CREATE DATABASE [test1] ON PRIMARY ( NAME = N'test1', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\test1.mdf', …
thiagocfb
  • 323
  • 1
  • 2
  • 4