Re: Optimising a query on a large table.

2004-12-24 Thread Rob Keeling
Thanks to all that replied, it turns out that the great delay was due to the use of the "like" opperator, I did have an index on person_id + session_start, just a thought though, using this will mysql pull out data ordered as per the index? Yes, sql is VERY limited, thanks for the pointers. Merr

RE: Optimising a query on a large table.

2004-12-23 Thread Donny Simonton
Rob, First of all I would say, your query is pretty badly laid out. First, unless you need every fields from a table returned only ask for those specific fields, and do you have an index on the combination of person_id + session_start? If not, your query will always be slow. But this is how I wo

Re: Optimising a query on a large table.

2004-12-23 Thread Joerg Bruehe
Hi Rob! Am Don, 2004-12-23 um 18.54 schrieb Rob Keeling: > I have a 152MB MyISAM table that I am trying to execute a simple select > statement on, > I need to retreave all rows with a given index, sorted by date. > > This is taking a very long period of time to execute. Can you give the time

Re: Optimising a query on a large table.

2004-12-23 Thread Rob Keeling
"kernel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Rob, > Have you run "show full processlist;" to see if it is copying to a tmp > table ?? > > walt Nothing listed other than the query itself. Should have said its on Mysql 3.21. Rob Keeling -- I love deadlines. I love the

Re: Optimising a query on a large table.

2004-12-23 Thread kernel
Rob Keeling wrote: I have a 152MB MyISAM table that I am trying to execute a simple select statement on, I need to retreave all rows with a given index, sorted by date. This is taking a very long period of time to execute. What can I do to speed up the query. The sql is, SELECT * FROM table WHERE