Re: why mysql choose a bad query

2010-11-05 Thread Changying Li
index ? Todd Lyons writes: > 2010/11/4 Changying Li : >>  PRIMARY KEY (`threadid`), >>  KEY `dateline` (`dateline`), >>  KEY `forumid_2` (`forumid`,`thread_type_id`,`visible`,`sticky`,`dateline`), >>  KEY `forumid` (`forumid`,`visible`,`sticky`,`dateline`) >> ) E

why mysql choose a bad query

2010-11-04 Thread Changying Li
gt; explain SELECT * FROM `abc` WHERE `forumid` = 25 AND `visible` = 1 AND `sticky` = 0 order by dateline \G *** 1. row *** id: 1 select_type: SIMPLE table: abc type: ref possible_keys: forumid_2,forumid key: forumid_2

2 masters problem.

2008-08-29 Thread Changying Li
that is, when A write its sql to binlog, it think its server-id as 1, but when it execute binlog copyed from B, it think its sever-id as 11. so sql is executed again and again. My question is: what's the proper way to change server's server-id ? why don't its server id change? --

Re: mysql slave got duplicate error (1062) frequently

2008-07-10 Thread Changying Li
my sql version is mysql> select version(); +--+ | version()| +--+ | 5.0.24a-standard-log | +--+ 1 row in set (0.00 sec) linux kernel 2.6.11.6 Changying Li <[EMAIL PROTECTED]> writes: > I set a master and a s

mysql slave got duplicate error (1062) frequently

2008-07-10 Thread Changying Li
NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY (`stat_id`), UNIQUE KEY `user_column` (`user_id`,`column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 so I got dup error at the last line. I think something is wrong in the process of binlog replication, like, the 'de

Re: why doesn't mysql select the correnct index?

2008-04-15 Thread Changying Li
Sebastian Mendel <[EMAIL PROTECTED]> writes: > Changying Li schrieb: >>>>>> why does mysql use group_id index ? >>>>> because in this case group_id would be faster than user_id >>>> but in fact group_id is very slow (51.21 sec), user_id is (0.

Re: why doesn't mysql select the correnct index?

2008-04-14 Thread Changying Li
ed 'select count(*) from photo where group_id=0 and album_id!=0,' ant it get a huge number, but not the value of rows. > > -- > Sebastian > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:http://lists.m

Re: why doesn't mysql select the correnct index?

2008-04-14 Thread Changying Li
Sebastian Mendel <[EMAIL PROTECTED]> writes: > Changying Li schrieb: >> Hi. there is a table photo and two queries: >> mysql> show index from photo; >>

why doesn't mysql select the correnct index?

2008-04-14 Thread Changying Li
#x27;0' AND group_id = '0' AND photo_id > '27103315' AND rating != '1' AND user_id = '882092' ) ORDER BY photo_id LIMIT 50; Empty set (0.00 sec) why does mysql use group_id index ? how to let mysql choose user_id as an in