Partial Index with group by

2011-06-06 Thread Les Fletcher
going on for my personal knowledge. Any insights would be great. Thanks. Les Fletcher -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: integers fields and strings

2008-03-14 Thread Les Fletcher
Thanks for the link. That helps a lot. Rob Wultsch wrote: On Fri, Mar 14, 2008 at 12:04 PM, Les Fletcher <[EMAIL PROTECTED]> wrote: | Field | Type| Null | Key | Default | Extra | | intfield1 | smallint(6) | YES | | 0| | | intfield2 | smallint(6)

integers fields and strings

2008-03-14 Thread Les Fletcher
I am having some issues with some integer fields and string input. The table setup is the following: | Field | Type| Null | Key | Default | Extra | | intfield1 | smallint(6) | YES | | 0| | | intfield2 | smallint(6) | YES | | NULL| | | intfield3 | smal

Re: ON vs. WHERE

2008-01-30 Thread Les Fletcher
Are specifying the joins more optimal than using a multiple from and a where clause when doing an inner join? SELECT tbl1.*,tb2.* FROM tbl1, tbl2 WHERE tbl1.col1=tbl2.col2; vs. SELECT tbl1.*,tb2.* FROM tbl1 JOIN tbl2 ON tbl1.col1=tbl2.col2; vs. SELECT tbl1.*,tb2.* FROM tbl2 JOIN tbl1 ON tbl1

Re: GROUP BY...not using index?

2007-09-13 Thread Les Fletcher
If I am not mistaken, group by only uses an index if the index is first used as part of the where clause and is compared to a constant. You'd need a two column index for this query: INDEX(active,food) The 'active' part would be used in the where clause, and the second part ( "food" ) could t

Re: counting on a complex query

2007-08-01 Thread Les Fletcher
SQL_CALC_FOUND_ROWS isn't an option for us. Right now I am doing two queries, but I am just trying to see if there is a better way to do the count query than to just turn it into a dervied table and count the results i.e. SELECT COUNT(*) FROM (big nasty query) t1. I think what the question is

counting on a complex query

2007-08-01 Thread Les Fletcher
I have a nice little query that I can get the results from fine, but am having problems figuring out the best way to get the count directly from mysql. The query looks like the following: SELECT t1.id, t1.col1, t2.id, t2.col1, t2.col2, t2.col3, t2.col4 FROM t1 JOIN t2 ON ( t2.id = t1.col1 ) W

index overhead

2007-05-16 Thread Les Fletcher
I have two questions about the overhead associated with updating the indexes when records are added, deleted or modified. Lets say I have a table of 1 million records that is partitioned on partitionedfield (10 distinct values). id int partitionedfield int property1 int property2 int property