RE: alternative to slow query

2012-07-16 Thread Rick James
Please provide SHOW CREATE TABLE for the two tables. Plan A: Would the anti-UNION problem be solved by hiding the UNION in a subquery? The outer query would simply return what the UNION found. Plan B: Insert every row twice into expression_expression -- (e1,e2) and also (e2,e1). Then, you need

RE: Subquery taking too much time on 5.5.18?

2012-07-16 Thread Rick James
How fast does this run? SELECT A.* FROM A JOIN B ON B.A_ID = A.id WHERE B.name LIKE 'X%'; Turning a subquery into a JOIN usually improves performance. (The main exception is when the subquery consolidates data via GROUP BY, DISTINCT, LIMIT, etc.) > -Original Message-

RE: Subquery taking too much time on 5.5.18?

2012-07-16 Thread Rick James
> query B can not used any key because 'like' never can use any key Not true. LIKE without a leading wildcard is optimized like a BETWEEN. > -Original Message- > From: Reindl Harald [mailto:h.rei...@thelounge.net] > Sent: Friday, July 06, 2012 8:58 AM > To: mysql@lists.mysql.com > Subject

RE: GA download reverted back to 5.5.24?

2012-07-16 Thread Rick James
Shawn, can you explain why one of the links on that page is broken? http://bugs.mysql.com/bug.php?id=14248833 Says "No such bug #14248833 or bug is referenced in the Oracle bug system." > -Original Message- > From: Shawn Green [mailto:shawn.l.gr...@oracle.com] > Sent: Monday, July

RE: Trouble with Average

2012-07-16 Thread Rick James
Here's a different way to "smooth" numbers. It uses an exponential moving average instead of "the last 5". SELECT Time, @a := (9 * @a + Value) / 10 AS moving_avg FROM tbl JOIN ( SELECT @a := 0 ) AS x; Notes: * Make 10 larger or smaller, depending on how smooth you want it. * 9=10-1 *

RE: Fwd: Query take too long time - please help!

2012-07-16 Thread Rick James
If the collation for ksd in ..._ci, then it is "case-insensitive", and you can get rid of both calls to LOWER(). > -Original Message- > From: Carsten Pedersen [mailto:cars...@bitbybit.dk] > Sent: Tuesday, July 10, 2012 11:22 AM > To: Darek Maciera > Cc: mysql@lists.mysql.com > Subject: Re

RE: MySQL crashed..

2012-07-16 Thread Rick James
> 120711 8:12:22 [ERROR] /usr/sbin/mysqld: Incorrect key file for table > './mydb/wp_posts.MYI'; try to repair it > 120711 8:12:22 [ERROR] Got error 126 when reading table './mydb/wp_posts' Well, do REPAIR TABLE wp_posts; > -Original Message- > From: J M [mailto:jerom...@gmail.com] > S

RE: Unique index - opinions sought

2012-07-16 Thread Rick James
Did you really mean to have start/end_date in both tables? Are the values identical? If they are, that is another reason to use an INT UNSIGNED AUTO_INCREMENT. Done correctly, JOIN can usually run faster than two separate queries. SELECT d.* FROM item_detail AS d JOIN item_spine AS

RE: why this query doesn't use index?

2012-07-16 Thread Rick James
Things like that are hard to optimize. If you have no overlapping ranges, then this will be much more efficient: http://mysql.rjweb.org/doc.php/latlng > -Original Message- > From: Doug [mailto:d...@hacks.perl.sh] > Sent: Thursday, July 12, 2012 7:03 PM > To: mysql@lists.mysql.com > Sub

Re: Unique index - opinions sought

2012-07-16 Thread Mark Goodge
On 16/07/2012 17:39, Rick James wrote: How many rows? If 1K, it does not matter. If 1 billion, we need to discuss in more detail. Let's assume 1M... Around 1M in the item_spine table and 10M in item_detail. Dates should be stored in DATE datatype, which is 3 bytes. Your GUID is non-standa

RE: mysql - uppoer limit for doing simultaneous red/writes..

2012-07-16 Thread Rick James
What does "simultaneous connection" mean? 1000 open connections is reasonable; 10 _active_ connections is reasonable; 1000-1 queries/second may be reasonable. If these are readonly connections, then you could set up any number of Slaves. 100 Slaves with 1000 connections each would achieve

RE: Unique index - opinions sought

2012-07-16 Thread Rick James
How many rows? If 1K, it does not matter. If 1 billion, we need to discuss in more detail. Let's assume 1M... Dates should be stored in DATE datatype, which is 3 bytes. Your GUID is non-standard, but should probably be stored in CHAR(6) CHARACTER SET ascii, unless it is expected to have non-

Unique index - opinions sought

2012-07-16 Thread Mark Goodge
I have a MySQL table (call it, say, item_spine) which contains three fields which, together, form a unique key. These three fields are a guid, a start date and an end date. The guid is alphanumeric (a fixed-length six characters) and the dates are ISO format dates (-MM-DD). I also have an

Looking for consultant

2012-07-16 Thread Carl Kabbe
We are looking at installing an NDB cluster and are looking for someone to assist us in setting it up. Thanks, Carl -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql