*** Is everyone else getting ~50% virus e-mails on the list?? :-( ***

Hi Kevin,

Don't know what's causing the hang-up on those queries, as they seem
like they should be fast as you said (unless it's some mod_perl/DBI
interaction -- no idea). :-/ Just responding to 2 other things...


----- Original Message -----
From: "Kevin"
Sent: Wednesday, September 24, 2003 5:34 PM
Subject: 300 seconds in sending data phase


> Hello,
>
> [ snip ]
>
> The long 'sending data' phase seems to happen for many different
> queries.  The explain for the top query shows:
> ----------------------------+
> | table | type   | possible_keys | key       | key_len | ref        |
> rows |
>
+-------+--------+---------------+-----------+---------+------------+---
> --
> | bids  | range  | remaining     | remaining |       2 | NULL       |
> 192 | Using where; Using filesort |
> | poets | eq_ref | PRIMARY       | PRIMARY   |       3 | bids.owner |
> 1 |                             |
> | poems | eq_ref | PRIMARY       | PRIMARY   |       3 | bids.lid   |
> 1 |                             |
>
+-------+--------+---------------+-----------+---------+------------+---
> ---
>
> Sure, it's a filesort, but only 192 rows so should be no big deal.
> (Side note: the 'remaining' key is on (remaining, amt), so shouldn't
it
> be using it and not filesorting?).

No, because the bids table is "range" type (because of "WHERE remaining
> 0"). It would need to be "ref" type to use the index for sorting
(WHERE remaining=123 or something). This is because the index is only
sorted by "amt" for each unique "remaining" prefix value.

(Note that before v4, MySQL will not use the index for ORDER BY with
queries of type "... WHERE key_part1=const ORDER BY key_part2 DESC".
:-()


> Which is strange too because it has way more processes than apache can
> be using (should be only one persistent connection per process)

Should it? Or is it one connection per MySQL user, per process? I'm not
sure. Are you connecting with more than 1 MySQL user?

BTW, this is why I don't like persistent connections. :-) Too many
useless connections around that can't be used in a shared pool...


Matt


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

Reply via email to