Re: Partial char key not used in conjuction with inequality comparison (MySQL5)

2007-04-30 Thread Joerg Bruehe
Hi Thomas, all! Thomas van Gulick wrote: [[...]] Test: EXPLAIN SELECT * FROM t WHERE T=x; Result: key T used EXPLAIN SELECT * FROM t WHERE T!=x; Result: key T _unused_ To be expected: An unequal condition will evaluate to true for a very large proportion of the index entries, so the

Re: spool data/log into a file.

2007-04-30 Thread Joerg Bruehe
Hi Michale, all [EMAIL PROTECTED] wrote: most likely you just need to redirect STDERR to tee as well so it's not a mysql problem: mysql -u -p -f eof 21 | tee ttt.txt ... assuming it's Bourne or ksh, don't remember what's csh for 21 It is an appended '': prog file

Re: Building MySQL Under low memory conditions (CFLAGS not working?)

2007-04-30 Thread Joerg Bruehe
Hi Weston, all, Weston C wrote: Hi, I'm trying to build MySQL 4.1.22 on a VPS where it looks like our available memory could be as low as 32MB, and compilation is erroring out partway through with a virtual memory exhausted: cannot allocate memory message. 32 MB isn't much, nowadays -

Re: mysql connections - how to stop flooding?

2007-04-30 Thread Brent Baisley
My first guess would be that you have a MyISAM table that gets hit with a long running query which locks the table. When that happens, all other queries start queueing up and connections will rise as new queries come in. Once the long running query finishes, all the other queued queries run and

Re: Should the db be shutdown before backing up?

2007-04-30 Thread Gerald L. Clark
Mathieu Bruneau wrote: murthy gandikota a écrit : Hi I did a hot backup a while ago. When I had to restore from backup there were several error messages. So I ran mysqlcheck for every table with --auto-repair option. Is this the best way? Thanks Murthy

RE: Optimize code?

2007-04-30 Thread Jerry Schwartz
Thanks, Jay. Comments interspersed... Jerry Schwartz wrote: I need (ultimately) to update some prices in a prod_price table. First, I need to locate a product and its associated prices using a field prod.prod_price_prod_id which is not unique, and is often null, but it is indexed.

Re: Interesting SQL Query - Total and Grouped Counts together?

2007-04-30 Thread Imran Chaudhry
Baron, Thanks very much for that simple but very effective solution. I altered your SQL slightly, the final SQL looks like this: SELECT domain, count(*) AS 'count all', SUM(IF(mime = 'text/html', 1, 0)) AS 'count text', SUM(IF(mime LIKE 'image/%', 1, 0)) AS 'count image' FROM tableA

RE: Research Subjects drawn randomly from databases

2007-04-30 Thread Jerry Schwartz
Is your ID field an integer? If not, you might be running into some rounding corner cases. I don't see why that would happen, off-hand, since integers can be stored exactly as binary floating point numbers, but who knows. To satisfy your curiosity, you could SELECT COUNT(*) FROM table WHERE

Re: Building MySQL Under low memory conditions (CFLAGS not working?)

2007-04-30 Thread Weston C
Joerg Bruehe [EMAIL PROTECTED] wrote: Also, virtual memory is not just RAM, it also includes your paging space (aka swap device): check its size and usage. This is a really good point. Are there some other parameters (either compiler or environment) I should be trying to tweak in addition to

mysql merge table

2007-04-30 Thread Frederic Belleudy
hi there, i dont know if i did something wrong with the merge table or didnt understand the purpose of it so here is what i did, i ve created 2 tables with the same definition (keys and colums) then ive create the merge table and replace the primary key by an index key and every other

Re: Building MySQL Under low memory conditions (CFLAGS not working?)

2007-04-30 Thread Joerg Bruehe
Hi Weston, all! Weston C wrote: Joerg Bruehe [EMAIL PROTECTED] wrote: Also, virtual memory is not just RAM, it also includes your paging space (aka swap device): check its size and usage. This is a really good point. Are there some other parameters (either compiler or environment) I should

Re: mysql merge table

2007-04-30 Thread Rolando Edwards
Please do a 'show create table table name\G' Then we could explore the Merge Table scenario. - Original Message - From: Frederic Belleudy [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, April 30, 2007 11:14:24 AM (GMT-0500) America/New_York Subject: mysql merge table hi there,

Re: Should the db be shutdown before backing up?

2007-04-30 Thread murthy gandikota
Gerald L. Clark [EMAIL PROTECTED] wrote: Mathieu Bruneau wrote: murthy gandikota a écrit : Hi I did a hot backup a while ago. When I had to restore from backup there were several error messages. So I ran mysqlcheck for every table with --auto-repair option. Is this the best way?

RE: Research Subjects drawn randomly from databases

2007-04-30 Thread John Kebbel
id is an integer ... describe persons; ++---+--+-+-+---+ | Field | Type | Null | Key | Default | Extra | ++---+--+-+-+---+ | ID | int(11)

RE: INSERT ... ON DUPLICATE KEY UPDATE seems so close and yet so far...

2007-04-30 Thread Daevid Vincent
-Original Message- From: Philip Hallstrom [mailto:[EMAIL PROTECTED] Because if you wanted that you'd use REPLACE which is mysql specific which is okay since it's mysql you're using I guess. Except for the CRITICAL issue that REPLACE will DELETE the row first, thereby causing all

Re: Bin logs and mysql 4

2007-04-30 Thread Scott Tanner
On Fri, 2007-04-27 at 09:19 -0500, [EMAIL PROTECTED] wrote: So if one is doing a full mysqldump every night, all bin-logs can be deleted after this? On the slave - Yes. In fact I would highly recommend it before starting the slave processes again. This will reset the bin log's 'position'

InnoDB table lock on INSERT

2007-04-30 Thread Power, Paul C.
I have an INSERT waiting for a table lock, and i do not understand why. ---TRANSACTION 0 308691, ACTIVE 5 sec, process no 8876, OS thread id 1296547864 inserting mysql tables in use 1, locked 1 LOCK WAIT 1 lock struct(s), heap size 320 MySQL thread id 79126, query id 1113322 bil.oneeighty.com

status variables Table_Locks_*

2007-04-30 Thread Power, Paul C.
Table_Locks_Immediate and Table_Locks_waited. What does MySQL do exactly to get those values? Can it be determined what locks had to wait, and why? -Paul

Re: InnoDB table lock on INSERT

2007-04-30 Thread Baron Schwartz
Hi Paul, Power, Paul C. wrote: I have an INSERT waiting for a table lock, and i do not understand why. ---TRANSACTION 0 308691, ACTIVE 5 sec, process no 8876, OS thread id 1296547864 inserting mysql tables in use 1, locked 1 LOCK WAIT 1 lock struct(s), heap size 320 MySQL thread id 79126,

Re: status variables Table_Locks_*

2007-04-30 Thread Baron Schwartz
Power, Paul C. wrote: Table_Locks_Immediate and Table_Locks_waited. What does MySQL do exactly to get those values? Can it be determined what locks had to wait, and why? -Paul As far as I know, no. You should probably ask someone who really knows, but to my limited understanding, these

IS NULL Question

2007-04-30 Thread John Kebbel
I'm having problems understanding NULL. I grasp what a NULL value is, but I can't get NULL to perform correctly. For instance, if I do a Select statement, I see that I have columns with a NULL value. select first, last, suffix from persons LIMIT 5; +---+--++ | first |

Re: IS NULL Question

2007-04-30 Thread Jeremy Cole
Hi John, Are you sure they are actually NULL and not NULL (i.e. the string NULL)? Try this: SELECT first, last, ISNULL(suffix), LENGTH(suffix) FROM persons LIMIT 5; Regards, Jeremy John Kebbel wrote: I'm having problems understanding NULL. I grasp what a NULL value is, but I can't get NULL

Summer issue - MySQL e-zine

2007-04-30 Thread B. Keith Murphy
Everyone, I have received quite a bit of positive feedback on the idea of a MySQL e-zine and I am moving forward. I would like to have the first issue out by the 1st of June. I have decided to have a theme of the first issue on security? Why? Well, to be honest, it will any easier topic