Most Popular

1500 questions
72
votes
1 answer

What is the best way to reduce the size of ibdata in mysql?

I have some Production servers whose ibdata files increase in size day by day. It has already consumed 290GB of space. The tables in the servers are mostly InnoDB and there are high read and write requests. The log file size also increasing. There…
Abdul Manaf
  • 9,587
  • 16
  • 73
  • 84
72
votes
7 answers

When should I rebuild indexes?

When should I rebuild the indexes in my relational database (SQL Server)? Is there a case for rebuilding indexes on a regular basis?
Nick Chammas
  • 14,810
  • 17
  • 76
  • 124
72
votes
1 answer

How to manage DEFAULT PRIVILEGES for USERs on a DATABASE vs SCHEMA?

I want to migrate a fairly simple, internal, database driven application from SQLite3 to PostgreSQL 9.3 and tighten the permissions in the DB as I go. The application currently consists of a command to update the data; and one to query it.…
Jim Dennis
  • 775
  • 1
  • 7
  • 12
71
votes
7 answers

Connect with sqlplus from the command line using a connection string

Let's say I have an Oracle database. I have a username = x, password = y, database = z, port = a, SID = b, and Hostname = c. So, how do I connect correctly? I used many options like: sqlplus…
Edvinas
  • 711
  • 1
  • 6
  • 3
71
votes
4 answers

Can a single PostgreSQL query use multiple cores?

In recent versions of PostgreSQL (as of Dec 2013), can we share a query between two or more cores to get a performance boost? Or should we get faster cores?
Alireza
  • 3,676
  • 10
  • 38
  • 44
71
votes
6 answers

What are the differences between NoSQL and a traditional RDBMS?

What are the differences between NoSQL and a traditional RDBMS? Over the last few months, NoSQL has been frequently mentioned in the technical news. What are its most significant features relative to a traditional RDBMS? At what level (physical,…
Spredzy
  • 2,248
  • 2
  • 20
  • 25
71
votes
4 answers

Index Seek vs Index Scan

Looking at an execution plan of a slow running query and I noticed that some of the nodes are index seek and some of them are index scan. What is the difference between and index seek and an index scan? Which performs better? How does SQL choose…
Greg
  • 3,292
  • 5
  • 33
  • 57
71
votes
4 answers

Created user can access all databases in PostgreSQL without any grants

I must be missing something with regards to setting up PostgreSQL. What I'd like to do is create multiple databases and users that are isolated from each other so that a specific user only has access to the databases I specify. However, from what I…
mikeplate
  • 813
  • 1
  • 7
  • 4
71
votes
5 answers

Is it safe to use innodb_flush_log_at_trx_commit = 2

I turned innodb_flush_log_at_trx_commit = 2 and get a very fast write speed. But is it safe be used in production web site?
Bruce Dou
  • 855
  • 1
  • 9
  • 8
71
votes
6 answers

How restore a specific database from backup using mongorestore command

I created a backup of all my databases using mongodump command. Now I want to restore a specific database using mongorestore command. How is this possible, I use this command: --db option then mongodb doesn't restore a specific database.
pankaj choudhary
  • 841
  • 2
  • 8
  • 4
71
votes
8 answers

ERROR: no schema has been selected to create in

I am working on an amazon RDS postgresql database where I know there had been some issue with the public schema (maybe it was dropped). But apparently the schema exists, and anyway the problem is not solved. Here is a sample session with a newly…
Emanuele Paolini
  • 813
  • 1
  • 6
  • 7
70
votes
11 answers

Passing array parameters to a stored procedure

I've got a process that grabs a bunch of records (thousands) and operates on them. When I'm done, I need to mark a large number of them as processed. I can indicate this with a big list of IDs. I'm pulling the IDs down along with "payload" data via…
70
votes
3 answers

Why is a new user allowed to create a table?

I'm wondering why a newly created user is allowed to create a table after connecting to a database. I have one database, project2_core: postgres=# \l List of databases Name | Owner |…
andreas-h
  • 833
  • 1
  • 6
  • 6
70
votes
9 answers

Plural vs Singular Table Name

How should I name my Tables when creating a new database? Singular: Client or Plural: Clients?
69
votes
3 answers

How to grant super privilege to the user?

I have created a user and given privileges to the user1. `grant all privileges on db1.* to user1@'%' with grant option; Am using mysql workbench to import dumps to my database. While importing dumps to database db1,error occurs stating that ERROR…
delete my account
  • 801
  • 2
  • 7
  • 6