RE: Using GREATEST with DATETIME/TIMESTAMP values

2004-03-08 Thread Lance Lovette
>From what I can tell no coercion is necessary when the query references only DATETIME and TIMESTAMP columns but when the query includes literals you don't get the correct results unless you format the dates. Take for example a table with a DATETIME column (DT) and a TIMESTAMP column (TS). The foll

Using GREATEST with DATETIME/TIMESTAMP values

2004-03-06 Thread Lance Lovette
What is the best or most efficient way to compare a mix of DATETIME and TIMESTAMP values using GREATEST()? Some values are columns and some are literals. Should I convert TIMESTAMP values to DATETIME formatted strings using DATE_FORMAT or convert everything to integers using UNIX_TIMESTAMP and then

Query much slower after REPAIR TABLE

2003-05-31 Thread Lance Lovette
In a nutshell, I have a query that runs in 28 seconds until I perform a REPAIR TABLE against one of the tables in the query then execution time jumps to 51 seconds. The only way to get the query time back down is to TRUNCATE and repopulate the table. I've been operating under the assumption that RE

RE: Is there a SQL/diff program out there?

2003-02-11 Thread Lance Lovette
I've been happy with mysqldiff. http://adamspiers.org/computing/mysqldiff/ Lance - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To requ

Delayed_insert threads not exiting

2002-11-21 Thread Lance Lovette
My delayed_insert_timeout is the default 300 seconds. Why then would I have DELAYED threads that have been idle for 14+ hours? +--+--+---+++---+--- -+--+ | Id | User | Host | db | Command

table_cache too high?

2002-11-19 Thread Lance Lovette
My database has many hundreds of tables. Originally I set my table_cache to 512. Today I realize this might not be a good idea. By default open_files_limit is 0. According to my understanding of the manual this means each MySQL process will open at most 1124 file handles: max_connections + (table_

Relationship between Questions and Com_*

2002-07-07 Thread Lance Lovette
If I want to break down what types of queries my server is handling (INSERT/DELETE/UPDATE/etc) I can look at the Com_* values provided by SHOW STATUS. If I sum up the Com_* values I get a number much larger than the value of Questions. My guess is that this is because REPLACE executes both an INSE

Synchronize only database structures

2002-05-16 Thread Lance Lovette
I have partitioned my data such that each client has its own database (clientdb1, clientdb2, ... clientdbN). All the databases have the same structure (same tables, columns, etc.). This design works great except for one caveat - when I make a change to the database structure I have to make the sam

RE: ERROR 1060: Duplicate column name

2001-07-17 Thread Lance Lovette
would not have noticed all the 320MB temporary tables I'd have been creating. -Original Message- From: Sinisa Milivojevic [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 17, 2001 6:40 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: ERROR 1060: Duplicate column name Lance Lo

RE: ERROR 1060: Duplicate column name

2001-07-16 Thread Lance Lovette
l Widenius [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 9:32 AM To: Lance Lovette Cc: MySQL Subject: ERROR 1060: Duplicate column name Hi! >>>>> "Lance" == Lance Lovette <[EMAIL PROTECTED]> writes: Lance> The following CREATE TABLE statements seem st

Can't find record in '#sql45e7_70df_3'

2001-07-13 Thread Lance Lovette
I recently upgraded from MySQL 3.23.36 to 3.23.39 and now the following query fails. > SELECT DISTINCT Ring.*, Question.DefaultRingID, COUNT(RingMember.UserID) AS MemberCount FROM Ring, Question, QuestionXQuestionCategory, BrandXQuestionCategory LEFT JOIN RingMember ON (Ring.RingID = RingMember.R

ERROR 1060: Duplicate column name

2001-07-13 Thread Lance Lovette
The following CREATE TABLE statements seem straight forward but they all fail. Can someone explain why they fail and what I can do to get rid of the "Duplicate column name" errors? mysql> CREATE TEMPORARY TABLE User2 (UserID int(11)) SELECT UserID FROM User; ERROR 1060: Duplicate column name 'Us

INSERT DELAYED and auto_increment: NULL or 0?

2001-03-08 Thread Lance Lovette
I am confused about the way INSERT DELAYED reacts to setting an auto_increment field to NULL. I am inserting records into a table where one of the columns is auto_increment. Usually when setting the value of an auto_increment field in an INSERT query I pass a value of NULL. When I do the same thin

Failed INSERT DELAYED blocks future INSERTs in 3.23.32

2001-03-07 Thread Lance Lovette
If I INSERT DELAYED into a table with an auto_increment column and specify a value of NULL for that column, the query fails. This is to be expected. After this failure however, normal INSERT queries start piling up in the 'Locked' state and remain there indefinitely. The only way to get things bac

RE: mysql hanging on mysqldump output

2001-02-08 Thread Lance Lovette
Problem: No space left on device Solution: Pay more attention to partition sizes I would have expected mysql to start failing queries on such an event. -Original Message- From: Lance Lovette [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 07, 2001 8:08 PM To: MySQL Subject: mysql

mysql hanging on mysqldump output

2001-02-07 Thread Lance Lovette
I am trying to copy data from one database to another using output from mysqldump version 8.11 distributed with 3.23.28-gamma. The problem is that part way through importing the data into the target database, mysql just hangs. When I show the process list, there is only one query, and it's stuck i