Simple query slow on large table

2009-08-18 Thread Simon Kimber
Hi Everyone, I'm having a very simple query often take several seconds to run and would be hugely grateful for any advice on how i might spped this up. The table contains around 500k rows and the structure is as follows:

Re: Simple query slow on large table

2009-08-18 Thread walter harms
Simon Kimber schrieb: Hi Everyone, I'm having a very simple query often take several seconds to run and would be hugely grateful for any advice on how i might spped this up. The table contains around 500k rows and the structure is as follows:

Akhirnya bertemu jugak lubuk yg banyak ikan........

2009-08-18 Thread aslani m yan
Salam buat anda yang saya hormat, Saya memohon maaf kerana emel yang tak diundang ini. Sebagai seorang Pemasar Internet Sambilan, saya sentiasa mencari dan terus mencari ruang dan peluang bagaimana merealisasikan impian menjana pendapatan sebenar dari usaha dan modal yang telah dikorbankan.

Re: Simple query slow on large table

2009-08-18 Thread Perrin Harkins
On Tue, Aug 18, 2009 at 5:08 AM, Simon Kimbersi...@internetstuff.ltd.uk wrote: I have indexes on siteid, datestamp and msgtype. Queries such as the following are constantly appearing in the slow queries log: SELECT * FROM enquiries WHERE siteid = 59255 AND msgtype = 0 ORDER BY datestamp

Query Question

2009-08-18 Thread Bill Arbuckle
I am in need of some help for the following: Say I have a table with 1M rows. Users are being added constantly (not deleted) during the queries that I am about to explain. The pk is uid and appid. I need to run queries in increments of 100K rows until reaching the end without duplicating

Re: Query Question

2009-08-18 Thread Walter Heck - OlinData.com
Bill, if you use an order by clause in your query, the limit will pick the first 100K rows in that order. That way you can ensure that all rows will be processed in (wait for it...) order :) Cheers, Walter On Tue, Aug 18, 2009 at 18:44, Bill Arbuckle b...@arbucklellc.com wrote: I am in need

RE: Query Question

2009-08-18 Thread Gavin Towey
To further emphasize this point: A table has no order by itself, and you should make no assumptions about the order of rows you will get back in a select statement, unless you use an ORDER BY clause. Regards, Gavin Towey -Original Message- From: walterh...@gmail.com

Re: Query Question

2009-08-18 Thread Martijn Tonies
To further emphasize this point: A table has no order by itself, That's not entirely true ;-) Records are stored in some kind of physical order, some DBMSses implement clustered keys, meaning that the records are stored ascending order on disk. However... and you should make no

Re: Query Question

2009-08-18 Thread Johnny Withers
It may be true that some DBMSs physically store rows in whatever order you speicfy; however, this is a MySQL list, and MySQL does not do this (InnoDB anyway). For example, take a table with 10,000,000 rows and run a simple select on it: Database changed mysql SELECT id FROM trans_item LIMIT 1\G

Re: Query Question

2009-08-18 Thread Martijn Tonies
It may be true that some DBMSs physically store rows in whatever order you speicfy; That's not what I said. however, this is a MySQL list, and MySQL does not do this (InnoDB anyway). For example, take a table with 10,000,000 rows and run a simple select on it: Database changed mysql