Re: slow.log by date

2008-11-30 Thread chaim . rieger
Write a perl script Am sure there are some out there Look at addons for awstats. --Original Message-- From: Fayland Lam To: [EMAIL PROTECTED] Cc: mysql@lists.mysql.com Subject: Re: slow.log by date Sent: Nov 30, 2008 18:37 [EMAIL PROTECTED] wrote: > Syslog-ng combined with logrotate >

Re: slow.log by date

2008-11-30 Thread Fayland Lam
[EMAIL PROTECTED] wrote: Syslog-ng combined with logrotate well, logrotate is for the coming log. what can we do towards existing ones. :) Thanks. --Original Message-- From: Fayland Lam To: mysql@lists.mysql.com Subject: slow.log by date Sent: Nov 30, 2008 18:22 well, our slow

Re: slow.log by date

2008-11-30 Thread chaim . rieger
Syslog-ng combined with logrotate --Original Message-- From: Fayland Lam To: mysql@lists.mysql.com Subject: slow.log by date Sent: Nov 30, 2008 18:22 well, our slow.log is pretty huge and say I just want the logs in the last week. (tail -n XXX is not good enough) I'm wondering there is

slow.log by date

2008-11-30 Thread Fayland Lam
well, our slow.log is pretty huge and say I just want the logs in the last week. (tail -n XXX is not good enough) I'm wondering there is a script (Perl or bash or others) can do this? I'm not willing to reinvent the wheel. :) Thanks. -- Fayland Lam // http://www.fayland.org/ Foorum based on C

RE: Result ordering

2008-11-30 Thread Martin Gainty
instead of > SELECT name, (CASE WHEN bar = 34 THEN 0 ELSE 1 END) AS rank> FROM foo> WHERE > bar = 34> OR baz > 100> ORDER BY rank ASC, baz DESC> LIMIT 5; you can use order the query evaluation to perform inner subquery first select distinct foo.name,foo.bar,baz.bar from foo where exists (selec

Re: Result ordering

2008-11-30 Thread Morten
On Nov 30, 2008, at 11:42 PM, Andy Shellam wrote: Hi Morten, I think this is valid in MySQL (it certainly is for SQL Server) but you can use a CASE statement directly in the ORDER BY clause. Try something like this: SELECT name FROM foo WHERE bar = 34 OR baz > 100 ORDER BY CASE ba

Re: Result ordering

2008-11-30 Thread Andy Shellam
Hi Morten, I think this is valid in MySQL (it certainly is for SQL Server) but you can use a CASE statement directly in the ORDER BY clause. Try something like this: SELECT name FROM foo WHERE bar = 34 OR baz > 100 ORDER BY CASE bar WHEN 34 THEN 0 ELSE 1 END ASC, baz DESC LIMIT 5; Re

Result ordering

2008-11-30 Thread Morten
Hi, I'm retrieving the name of some records where either one of two criteria are satisfied: SELECT name FROM foo WHERE bar = 34 OR baz > 100 ORDER BY baz DESC LIMIT 5; I would like to sort that result set, such that the records matching bar = 34 occur before records with baz > 100.

Re: mysql master slave security considerations and planning

2008-11-30 Thread Chandru
Hi Madan, Nice to hear that you have got started up in MySQL and setup your first replication setup. MySQL has SSL replication that can be configured between master and slave if you feel that data is going to be transferred outside the network, I don't think that you will face such a scenario. Pe