Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-21 Thread Arthur Radulescu
> Creating a combined index can help MySQL in using this index for both the > where condition and the order by clause. > Try the query with an index on cat,date and with date,cat; maybe one will be > faster than the other. This partially solved my problem. Thanks a lot. However I am facing a new p

Re: how to speed up a simple query? need some help here...

2004-04-20 Thread Arthur Radulescu
> Create composite index on (cat, date). Use EXPLAIN to see if MySQL uses index: > http://dev.mysql.com/doc/mysql/en/EXPLAIN.html This partially solved my problem. Thanks a lot. However I am facing a new problem here. The query where I am ordering by a column is much more slowly than the same que

Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Arthur Radulescu
> 1. MySQL only uses one index for each table in a JOIN; this query only uses > one table, so only one index is used. > 2. DESC is slower than ASC > 3. Try creating an index on two columns; try cat and date, and try date and > cat. > 4. Check EXPLAIN SELECT id,name.. to see whether the right in

Re: how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Jigal van Hemert
> select id,name,desc,cat,date from table where cat='12' > > however I need to order the results by date desc... I have indexes on both > the cat and date (of type timestamp) fields however this operation is much > more slowly when I used the order So the result is something like this > > selec

Re: how to speed up a simple query?

2004-04-20 Thread Egor Egorov
"Arthur Radulescu" <[EMAIL PROTECTED]> wrote: > > I have a simple query on a table of about 1,000,000 records... The table is > optimized and the query is pretty simple at this moment... something like > this > > select id,name,desc,cat,date from table where cat='12' > > however I need to order

how to speed up a simple query? can anyone help with an ideea?

2004-04-20 Thread Arthur Radulescu
Hello! I have a simple query on a table of about 1,000,000 records... The table is optimized and the query is pretty simple at this moment... something like this select id,name,desc,cat,date from table where cat='12' however I need to order the results by date desc... I have indexes on both the

how to speed up a simple query?

2004-04-19 Thread Arthur Radulescu
Hello! I have a simple query on a table of about 1,000,000 records... The table is optimized and the query is pretty simple at this moment... something like this select id,name,desc,cat,date from table where cat='12' however I need to order the results by date desc... I have indexes on both the