Most Popular

1500 questions
23
votes
3 answers

Date range query for past 24 hour in Mongo shell

I am setting a cron job to collect results from MongoDB database profiler. I'd like to collect results within a 24 hrs period. I plan to run mongo command with javascript. Question is, in Mongo shell, how do I write a query to find a date range from…
Howard Lee
  • 1,019
  • 3
  • 9
  • 15
23
votes
4 answers

MySQL error: Access denied for user 'a'@'localhost' (using password: YES)

I use the root account created the account 'a'@'%'. But I can't use the account to connect to MySQL server when I specify the host parameter. I can successfully connect without the -h parameter. Please see the transcript below. I hope someone can…
Just a learner
  • 2,682
  • 7
  • 34
  • 53
23
votes
5 answers

FOR XML could not serialize the data because it contains character (0x0000)

I have a big query (if necessary I will post it here) and I'm getting this error: Msg 6841, Level 16, State 1, Line 1 FOR XML could not serialize the data for node 'NoName' because it contains a character (0x0000) which is not allowed in XML.…
Racer SQL
  • 7,386
  • 14
  • 69
  • 128
23
votes
2 answers

can't connect to remote postgresql database

I'm trying to connect to a remote psql database. Before I added the pg_hba.conf entry with the client's IP address, I was getting an error message : xdev@xdevbox:~$ psql -U postgres testdb -h 10.1.1.47 psql: FATAL: no pg_hba.conf entry for host…
dot
  • 751
  • 5
  • 11
  • 21
22
votes
5 answers

Using IF in T-SQL weakens or breaks execution plan caching?

It has been suggested to me that the use of IF statements in t-SQL batches is detrimental to performance. I'm trying to find some confirmation or validate this assertion. I'm using SQL Server 2005 and 2008. The assertion is that with the following…
AnthonyWJones
  • 321
  • 2
  • 5
22
votes
5 answers

mysqldump Error 2013

I have a database installed, that I would like to backup in mysql. The problem is mysqldump fails on exporting the 'maia_mail' table # mysqldump -u root -p maia > maia.sql mysqldump: Error 2013: Lost connection to MySQL server during query when…
garfink
  • 321
  • 1
  • 2
  • 4
22
votes
5 answers

Using DISTINCT in window function with OVER

I'm trying to migrate a query from Oracle to SQL Server 2014. Here is my query which works great in Oracle: select count(distinct A) over (partition by B) / count(*) over() as A_B from MyTable Here is the error i got after tried to run this query…
Omri
  • 353
  • 1
  • 5
  • 17
22
votes
2 answers

Postgres incomplete startup packet error

I am attempting to install Postgres 9.3 on Ubuntu 14.04 and I am getting an irksome error on startup. Here's what I'm seeing: $ sudo service postgresql restart * Restarting PostgreSQL 9.3 database server * Error: could not exec…
andrewniesen
  • 661
  • 3
  • 10
  • 15
22
votes
4 answers

Why won't some DBMS's allow rollback for certain DDL statements?

Recently I found out that MySQL doesn't support rollback of DDL such as "alter table"... Being used to PostgreSQL, that struck me as odd, but a friend of mine told me that even Oracle doesn't allow it.. Are there technical reasons for not supporting…
Joril
  • 441
  • 1
  • 5
  • 10
22
votes
2 answers

PostgreSQL maximize performance SSD

I will have a huge PostgreSQL 9.3 database with many tables with more than 100M entries per table. This database will be basically be read-only (once I fill all the necessary tables and build the indexes no more write operations on the DB) and…
Alexandros
  • 1,012
  • 4
  • 12
  • 23
22
votes
2 answers

Fast hamming distance queries in postgres

I have a large database (16M rows) containing perceptual hashes of images. I'd like to be able to search for rows by hamming distance in a reasonable timeframe. Currently, as far as I properly understand the issue, I think the best option here would…
Fake Name
  • 1,336
  • 5
  • 16
  • 28
22
votes
5 answers

Does restarting SQL Server speed it up?

I have noticed that some DBAs restart SQL Server very frequently, sometimes even nightly. I believe they do it to free up some memory, or perhaps to speed up queries too. I know that after a restart query plans have to be recompiled, but even…
MAK
22
votes
2 answers

Does amazon rds PostgreSQL require vacuum?

It isn't clear if auto vacuum is running in rds. Thanks!
Chris kinsman
  • 221
  • 1
  • 2
  • 3
22
votes
2 answers

Get postgres snapshot from Amazon RDS

I can not find a simple way to get a copy of the nightly backup I take of my Amazon RDS postgres instance so I can restore it on my local machine to play with. Right now I'm doing a pg_dump when I need a copy, but it would be nicer (and faster,…
Hsiu Dai
  • 351
  • 1
  • 2
  • 5
22
votes
4 answers

MySQL - Alter table to automatically put in a UUID

Ok, I know I've done this before. But I cannot for the life of me figure it out. I created a table. One of the columns is labled "LogID", it is also the primary key. How do I alter it so that this column generates a UUID for each new entry?…
Matt Winer
  • 395
  • 1
  • 3
  • 7