From: zuerrong Date: 2010-12-01T18:18:57+09:00 Subject: Re: A algorithm for finding the number 2010/12/1 Mike Stephens : > The common sense thing to do is exactly what you have done. Make sure > you have indexes on the fields. If it's still slow, try a different > database. Yes I have added keys to the columns in mysql. While it's still slooow. So I was thinking moving the whole data into memory, and find a good algorithm for it. Thanks.