can you send the description of your table. There are lots of reasion for
slowing down your query but I dont thint Date_formate () is a cause for
slowing down the query.You have very less data only 35,000..
You can try to optimize by using

1. Create INDEX on case_id
2. optimize  and check table [tracking_id]
3. flush tables
4.flush table threads
5. User PROPER DATA TYPES in your table. like if you can use tinyint or
smallint as compare to INT then use that one etc.
Just try that one and send the table description and which version r u using

Abhi-

----- Original Message -----
From: "Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 08, 2003 10:32 AM
Subject: Disproportionately slow, but simple, query


> I've got what would be best described as a medium sized table, which
> normally queries quickly, except for this one...
>
> Table "data_static" has around 35,000 records.
> This trivial query:
>
> SELECT tracking_id,
>        complainant_email,
>        DATE_FORMAT(import_date,'%Y-%c-%e') AS date,
>        subject
> FROM data_static
> WHERE case_id = 0;
>
> ...gets explained thus:
>   table = data_static
>   type = ref
>   possible_keys = _case
>   key = _case
>   key_len = 8
>   ref = const
>   rows = 7126
>   Extra = where used
>
>
> It takes just right at 60 seconds to generate 6409 result rows.  Removing
> the "DATE_FORMAT" calculation doesn't have any impact.
>
> Why so slow?
>
> One thing I thought of, but isn't trivial to change, is that one of the
> fields is a "text" type that often holds near its size limit, so
individual
> records can be fairly large.
>
> Is this just a matter of getting the data off the disk and to the client,
or
> something else?
>
> Jim
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to