rang + order + limit optimization

2005-01-21 Thread Xuefer Tinys
i did "SELECT .. FROM table WHERE cateid=1 AND ctime>xx ORDER BY ctime DESC LIMIT 10" mysql can use INDEX(cateid,ctime), with NO filesort, this is very fast, cos LIMIT is used by optimization but now i have to query: cateid IN(1,2,3,4,5) now mysql use filesort, which is bad, cos it get all mat

Re: Limit Optimization??

2003-10-30 Thread Matt W
hat explains it. :-) Matt - Original Message - From: "Avenger" Sent: Wednesday, October 29, 2003 1:41 AM Subject: Re: Limit Optimization?? > That sooo cool... It was the very perfection of beauty. > > but i didnt' know.why my index (ClassID, Auditing, CreatedTime) ar

Re: Limit Optimization??

2003-10-29 Thread Avenger
That sooo cool... It was the very perfection of beauty. but i didnt' know.why my index (ClassID, Auditing, CreatedTime) are slowly as matt's (ClassID, Auditing, CreatedTime, ArticleID) could matt explain why? Thx matt.. On Tue, 28 Oct 2003 02:06:16 -0600 "Matt W" <[EMAIL PROTECTED]> wrote: > H

Re: Limit Optimization??

2003-10-28 Thread Matt W
, October 28, 2003 1:37 AM Subject: Re: Limit Optimization?? > It's my info publsih system > > My table structure : > # > # Table structure for table 'article' > # > CREATE TABLE article ( > ArticleID int(11) NOT NULL auto_increment, > ClassID

Re: Limit Optimization??

2003-10-28 Thread avenger
ee which columns can or should be added to > an index. > > Also, can you show which indexes are already on the table? The last > lines of "SHOW CREATE TABLE table;" with the KEY definitions is fine. > > > Matt > > > - Original Message - > From: "ave

Re: Limit Optimization??

2003-10-28 Thread Matt W
s are already on the table? The last lines of "SHOW CREATE TABLE table;" with the KEY definitions is fine. Matt - Original Message - From: "avenger" Sent: Monday, October 27, 2003 10:24 PM Subject: Re: Limit Optimization?? > good job!! > it short my query time f

Re: Limit Optimization??

2003-10-27 Thread avenger
> > > Hope that helps. > > > Matt > > > - Original Message - > From: "avenger" > Sent: Monday, October 27, 2003 7:57 PM > Subject: Limit Optimization?? > > > > Does mysql do any optimization for then one use > > > > `select

Re: Limit Optimization??

2003-10-27 Thread Matt W
quot;avenger" Sent: Monday, October 27, 2003 7:57 PM Subject: Limit Optimization?? > Does mysql do any optimization for then one use > > `select ... limit x,y`? > > For example, I have table with 200 records and want to do page web > interface to this table. > >

Limit Optimization??

2003-10-27 Thread avenger
Does mysql do any optimization for then one use `select ... limit x,y`? For example, I have table with 200 records and want to do page web interface to this table. When i use `select ... from table limit 150, 20 `, it will need more and more times (on my here is more than 60 sec). well,

Re: Re: Re: distinct / limit optimization

2001-07-02 Thread Sinisa Milivojevic
X Gogo writes: > Hi, > > I've been using 3.23.37 source tarball compiled for Linux 2.2.19. Now I > upgraded to 3.23.39 but still the same result... Anyway, it's not that > important - I was just wondering why SELECT DISTINCT ... LIMIT is slower than > the > one without LIMIT. It's not crucial

Re: Re: Re: distinct / limit optimization

2001-07-02 Thread X Gogo
cation and does not prevent MySQL from being my favourite cup of database tea :) Thanx! George - èçõîäíî ñúîáùåíèå - Îò: Sinisa Milivojevic <[EMAIL PROTECTED]> Òåìà: Re: Re: distinct / limit optimization >X Gogo writes: >> Well, the order in which the queries are made do

Re: Re: distinct / limit optimization

2001-06-30 Thread Sinisa Milivojevic
X Gogo writes: > Well, the order in which the queries are made doesn't matter. The query with > LIMIT is always slower than the one > without it. When I used EXPLAIN SELECT... I actually > found that MySQL uses temporary table for the query with > the DISTINCT / LIMIT combination. I presume this

Re: Re: distinct / limit optimization

2001-06-29 Thread X Gogo
well :) George - èçõîäíî ñúîáùåíèå - Îò: Gerald Clark <[EMAIL PROTECTED]> Òåìà: Re: distinct / limit optimization >Because it wasn't in system cache yet? > >X Gogo wrote: > >> Hi, >> >> I've tried the folowing query: >> SELECT DIS

Re: distinct / limit optimization

2001-06-29 Thread Gerald Clark
Because it wasn't in system cache yet? X Gogo wrote: > Hi, > > I've tried the folowing query: > SELECT DISTINCT column1 FROM table1 LIMIT 10; > and got the result for 0.23 sec. > Then I've tried the same query without limit: > SELECT DISTINCT column1 FROM table1; > and got the result fo

distinct / limit optimization

2001-06-29 Thread X Gogo
Hi, I've tried the folowing query: SELECT DISTINCT column1 FROM table1 LIMIT 10; and got the result for 0.23 sec. Then I've tried the same query without limit: SELECT DISTINCT column1 FROM table1; and got the result for 0.01 sec. which is some 23 times faster. There are about 1 rows i