On 20/12/2005, Marcus Bointon wrote:
> I have a table that contains around 400,000 simple names. It's
> displaying a subset of them (perhaps 5,000) them a page at a time in
> a web interface, sorted by name, so I have a query like this:
>
> SELECT * FROM names WHERE account=123 ORDER BY lastname,
> -Original Message-
> From: "Marcus Bointon" <[EMAIL PROTECTED]>
[SNIPPED]
> That takes 11 seconds to run. Without the order by it takes 0.13 sec.
> I have simple indexes on both first name and last name (they are
> sometimes searched separately). It strikes me that this is really
>
Hi Marcus,
Do you have the output of the EXPLAIN? I've found the number of rows
processed to be very instructional. If you could get this number down,
it may be well worth putting an index on the account column and
re-running the EXPLAIN to see how many rows are being processed.
I recently put an