Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'sql.': 0.07; '(aka': 0.09; 'analytic': 0.09; 'back-end': 0.09; 'subject:process': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'too.': 0.31; '13,': 0.31; 'larry': 0.31; 'received:google.com': 0.35; 'there': 0.35; 'subject:data': 0.36; 'done': 0.36; 'window': 0.38; 'pm,': 0.38; '12,': 0.39; 'though,': 0.39; 'either': 0.39; '2014,': 0.84; 'functions)': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=O1UiFKxomxIMVz2IJz1AMiYfpyXv/mJjexJNeS7nMGY=; b=nlsdHNAkg2L4dDWRv4kNg6ld0fXG3in4EC7yXlB9DJL3Y4UPeBNi52R2ylUg9TSl1z yAhDBOLkySZB43OScJazgTGjiEhYc6gbjY0aJjpN73zOHaB5ciddEI8sNWC6wwYGOnez FVYGzj+RXZ5rePUe0OT9zWJtL072POc9bC9R4+EBz2At5QDoZiiDC7/VUXBZ/VgenAAG 1I9FQTNSIw3HOt2VivHG90CkTD/LGlRuqwT5DJYK2I0MLeHZYKO/ZxNt0rOvjrnLWNgs a3gZxEUgEcCYAKNRFZerRVkSMo35HHsokG6fuHwZp3ZA8iGz0ZpWSra8udVkZXUoGL2e emYA== MIME-Version: 1.0 X-Received: by 10.68.247.6 with SMTP id ya6mr25670163pbc.45.1389565122901; Sun, 12 Jan 2014 14:18:42 -0800 (PST) In-Reply-To: <101148D9-DACE-4572-801D-3DDB4A215BF9@gmail.com> References: <101148D9-DACE-4572-801D-3DDB4A215BF9@gmail.com> Date: Mon, 13 Jan 2014 09:18:42 +1100 Subject: Re: efficient way to process data From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389565132 news.xs4all.nl 2933 [2001:888:2000:d::a6]:33721 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63803 On Mon, Jan 13, 2014 at 6:53 AM, Petite Abeille wrote: > On Jan 12, 2014, at 8:23 PM, Larry Martell wrote: > >> AFAIK, there is no way to do this in SQL. > > Sounds like a job for window functions (aka analytic functions) [1][2]. That's my thought too. I don't think MySQL has them, though, so it's either going to have to be done in Python, or the database back-end will need to change. Hard to say which would be harder. ChrisA