Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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; 'sure.': 0.05; 'chunk': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'longer.': 0.16; 'rows': 0.16; 'wrote:': 0.16; '>>>': 0.18; 'header:In-Reply-To:1': 0.22; 'interface': 0.23; '+0100,': 0.23; 'pm,': 0.24; 'aug': 0.24; 'received:84': 0.28; 'thu,': 0.28; 'oracle': 0.29; 'stefan': 0.29; 'strings.': 0.30; 'collecting': 0.31; 'chris': 0.32; 'list': 0.32; 'to:addr:python-list': 0.33; '...': 0.34; 'header:User-Agent:1': 0.34; 'subject: ?': 0.34; 'header:X-Complaints-To:1': 0.35; 'hold': 0.35; 'run': 0.37; 'but': 0.37; 'received:org': 0.38; 'allows': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'data': 0.39; 'to:addr:python.org': 0.39; "i'd": 0.40; 'happens': 0.40; 'your': 0.61; 'results': 0.61; 'straight': 0.63; 'vary': 0.64; '11,': 0.68; '10000': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Stefan Behnel Subject: Re: String concatenation - which is the fastest way ? Date: Fri, 12 Aug 2011 11:25:06 +0200 References: <20110810111754.GD5045@host.pgf.com.pl> <20110810133146.GE5045@host.pgf.com.pl> <20110811064030.GB4990@host.pgf.com.pl> <20110811134613.GE4990@host.pgf.com.pl> <20110811143923.GG4990@host.pgf.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: dslb-084-056-042-173.pools.arcor-ip.net User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 In-Reply-To: <20110811143923.GG4990@host.pgf.com.pl> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313141121 news.xs4all.nl 23979 [2001:888:2000:d::a6]:41620 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11264 przemolicc@poczta.fm, 11.08.2011 16:39: > On Thu, Aug 11, 2011 at 02:48:43PM +0100, Chris Angelico wrote: >> On Thu, Aug 11, 2011 at 2:46 PM, wrote: >>> This is the way I am going to use. >>> But what is the best data type to hold so many rows and then operate on them ? >>> >> >> List of strings. Take it straight from your Oracle interface and work >> with it directly. > > Can I use this list in the following way ? > subprocess_1 - run on list between 1 and 10000 > subprocess_2 - run on list between 10001 and 20000 > subprocess_3 - run on list between 20001 and 30000 > etc > ... Sure. Just read the data as it comes in from the database and fill up a chunk, then hand that on to a process. You can also distribute it in smaller packets, just check what size gives the best throughput. Still, I'd give each work parcel a number and then reorder the results while collecting them, that allows you to vary the chunk size and the process size independently, without having to wait for a process that happens to take longer. Stefan