From: Fred Lindberg Date: March 11 1999 9:28pm Subject: Re: Splitting query results among machines? List-Archive: http://lists.mysql.com/mysql/53 Message-Id: <19990311213047.21232.qmail@id.wustl.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit On Thu, 11 Mar 1999 13:21:15 -0800 (PST), Brian Bray wrote: >My question is how do I run a query and then reliably split the results of >the query among multiple machines. Say for example I do a SELECT * FROM >Bookmarks. I want machine 1 to handle the first 1/3 of the >resulting rows, machine 2 the 2nd 1/3 and so on. > >Any good Idea's? For ezmlm, a 53 way hash is calculated and stored with each address. The load can then be split. You can to your data add a column with either a hash or a random number (depending on if the number has to be calculatable from the data), then into your select add e.g. WHERE hash BETWEEN 0 AND 17, etc. As long as you cover the entire range without overlap, you can split any way you want. -Sincerely, Fred (Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)