Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed2.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'insert': 0.05; 'purpose.': 0.07; 'table.': 0.07; "(i'd": 0.09; 'subject:How': 0.10; 'cc:addr :python-list': 0.11; 'suggest': 0.14; '"insert': 0.16; '-tkc': 0.16; 'csv': 0.16; 'dump,': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'it;': 0.16; 'roy': 0.16; 'temp': 0.16; 'wrote:': 0.18; '(in': 0.22; 'cc:addr:python.org': 0.22; 'load': 0.23; 'url:dev': 0.24; 'initial': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'external': 0.29; '[1]': 0.29; 'xml': 0.29; '[2]': 0.30; 'loads': 0.31; 'allows': 0.31; 'file': 0.32; "we're": 0.32; 'table': 0.34; 'subject:with': 0.35; 'case,': 0.35; 'google': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'sure': 0.39; 'either': 0.39; 'url:5': 0.61; 'back': 0.62; 'complete': 0.62; 'such': 0.63; 'day.': 0.63; 'occur': 0.65; 'url:0': 0.67; 'believe': 0.68; 'smith': 0.68; 'bulk': 0.74; 'partial': 0.84; 'received:50.22': 0.84; 'subject:find': 0.84 Date: Fri, 29 Mar 2013 22:17:50 -0500 From: Tim Chase To: Roy Smith Subject: Re: How to find bad row with db api executemany()? In-Reply-To: References: <5155E32A.1000403@davea.name> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: python-list@python.org 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364613376 news.xs4all.nl 6899 [2001:888:2000:d::a6]:51662 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42308 On 2013-03-29 21:19, Roy Smith wrote: > We're doing it all in one transaction, on purpose. We start with > an initial dump, then get updates about once a day. We want to > make sure that the updates either complete without errors, or back > out cleanly. If we ever had a partial daily update, the result > would be a mess. Having had to do some similarly-sized bulk data loads (in my case, MSSqlServer at $JOB) couple other ideas occur to me: 1) I believe MySQL has a side-loading function (I'd have to go digging for it; a quick google suggests a "LOAD DATA INFILE" statement[1]) that allows you to load data from an external file such as an XML or CSV file 2) Load into a temp table in testable batches, then do some sort of batch insert into your main table. Again, a quick google suggest the "INSERT ... SELECT" syntax[2] -tkc [1] http://dev.mysql.com/doc/refman/5.1/en/load-data.html [2] http://dev.mysql.com/doc/refman/5.0/en/insert-select.html