| List: | General Discussion | « Previous MessageNext Message » | |
| From: | 周彦伟 | Date: | June 19 2009 2:52am |
| Subject: | How to Optimize distinct with index | ||
| View as plain text | |||
Hi, I have a sql : Select distinct user_id from user where key1=value and key2=value2 and key3=value2; I add index on (key1,key2,key3,user_id), this sql use temporary table howevery I have thousands of queries per second. How to optimize it? Anthoer question: Select * from user where user_id in(id1,id2,id3,id4,.....) order by use_id; I add index on user_id,but after in,order use temporary table, How to optimize it? Thanks! zhouyanwei
| Thread | ||
|---|---|---|
| • Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Matt Neimeyer | 19 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Johnny Withers | 19 Jun |
| • How to Optimize distinct with index | 周彦伟 | 19 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Dan Nelson | 19 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Matt Neimeyer | 19 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Brent Baisley | 19 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Matt Neimeyer | 22 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Peter Brawley | 20 Jun |
| • Re: Half Hour Sub-query in MySQL vs. 5 Seconds in VFP? | Walter Heck - OlinData.com | 20 Jun |
| • Re: How to Optimize distinct with index | Dan Nelson | 19 Jun |
| • Re: How to Optimize distinct with index | Darryle Steplight | 19 Jun |
| • Re: How to Optimize distinct with index | Moon's Father | 26 Jun |
