List:General Discussion« Previous MessageNext Message »
From:Walter Heck - Date:August 18 2009 4:51pm
Subject:Re: Query Question
View as plain text  

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 :)



On Tue, Aug 18, 2009 at 18:44, Bill Arbuckle <bill@stripped> wrote:

> 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 rows in the queries.  I am using a select statement
> with a limit of row_index and row_count.  This start row is where my
> question arises.
> If I make a query with limit 0,100000 then 2 minutes later 100000,100000
> then 2minutes later 300000,100000 and so on.  My question is are new rows
> added to the end of the table or will they randomly appear in my queries?
> If they are added to the end of the table, that is fine because I will pick
> them up in my final pass.
> I hope this is clear enough.  If not, let me know and I will provide more
> information.  Thanks!

Walter Heck, Engineer @ Open Query (
Affordable Training and ProActive Support for MySQL & related technologies

Follow our blog at
OurDelta: free enhanced builds for MySQL @

Query QuestionBill Arbuckle18 Aug
  • Re: Query QuestionWalter Heck - OlinData.com18 Aug
    • RE: Query QuestionGavin Towey18 Aug
  • Re: Query QuestionMartijn Tonies18 Aug
    • Re: Query QuestionJohnny Withers18 Aug
  • Re: Query QuestionMartijn Tonies18 Aug