try to make an index with both fields and delete the individual indexes.

the cause of why it takes much less time is because mysql cache, if tue
query is cached it usually takes 0 seconds, but when something is changed on
this table, cache is flushed and the query takes the real time it need.

----- Original Message -----
From: "Octavian Rasnita" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Monday, November 07, 2005 7:53 PM
Subject: low speed select


> Hi,
>
> I have tried:
>
> mysql> select count(*) from table_name where date='2005-11-07' and id=11;
> +----------+
> | count(*) |
> +----------+
> |        0 |
> +----------+
> 1 row in set (46.42 sec)
>
> As you may see, this query took more than 46 seconds and I don't know why.
> I am the single person that was using the database in the moment I've made
> that query, and there are no programs that use to lock the tables until
> finishing some other queries anyway.
>
> The table has an index on the data field and another index on the id
field,
> and usually takes much less time for such a query.
>
> This database is used in a web site and I see sometimes that it takes a
very
> long time for displaying some pages and now I know that the problem is the
> database.
>
> The version of MySQL which is installed on the computer I work is:
> 4.1.5-gamma-standard-log
>
> I know it could be a little older, but this could be the only problem?
(and
> the fact that is a gamma version?)
>
> Thank you.
>
> Teddy
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>
>
>



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to