Path: csiph.com!usenet.pasdenom.info!goblin1!goblin.stu.neva.ru!news2.euro.net!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'insert': 0.05; 'bug.': 0.09; 'mixed': 0.09; 'rows': 0.09; 'subject:How': 0.10; '(it': 0.16; 'agree.': 0.16; 'doubly': 0.16; 'dump': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'guys,': 0.16; 'inserting': 0.16; 'roy': 0.16; 'seconds.': 0.16; 'statements,': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'case.': 0.24; 'documented': 0.24; 'switch': 0.26; 'header:In-Reply-To:1': 0.27; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'getting': 0.31; 'usually': 0.31; 'loads': 0.31; '(i.e.': 0.33; 'could': 0.34; 'subject:with': 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'easily': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'truly': 0.60; 'more': 0.64; '30,': 0.65; 'mar': 0.68; 'smith': 0.68; '100': 0.79; '"hey,': 0.84; 'subject:find': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=hm5D3YqEgSqT4MWxlrtKjEWh4iflLbo5DjGeLuEtXRw=; b=nT+mIx9NaEJTRft/lYi0f2DC60HD7/n6Hs9yAA29C3CXrVYKtqZUeLLS6AxISUJVt9 x7mqvd3RgTSbNf4OnirVzzVXnozdsDifnLnMTMH0OlL+hK0zRc1qfc+0a9h7K296A9bs gxfBPEJBL6wG+f4AIMISH46BJajrWMdcgvzlQSfvyqpLsNz+9hQFFC5a3gb8FWWRuI5c HQE/u2XTaBlsgC66oqpTqM28rv0EE4TDwDISdSy6EvqaPKxnCsA91G7N/bKAFZio+V1B uv29qRmlKq1B4HaLVZkELGsL+X6yI6EuTX9YX1GajitD5ykKwzXIiFUW4w345nQ0BsgV VrAA== MIME-Version: 1.0 X-Received: by 10.220.231.199 with SMTP id jr7mr3342705vcb.70.1364611796423; Fri, 29 Mar 2013 19:49:56 -0700 (PDT) In-Reply-To: References: <5155E32A.1000403@davea.name> Date: Sat, 30 Mar 2013 13:49:56 +1100 Subject: Re: How to find bad row with db api executemany()? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 20 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364611804 news.xs4all.nl 6895 [2001:888:2000:d::a6]:39363 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:42302 On Sat, Mar 30, 2013 at 1:44 PM, Roy Smith wrote: > The slow way (i.e. "VALUES"), I'm inserting 1000 rows about every 2.4 > seconds. When I switch to "values", I'm getting more like 1000 rows in > 100 ms! > > A truly breathtaking bug. *facepalm* Doubly facepalm because a regex could easily have tested for mixed case. Especially facepalm because there's some way to do this that's faster than straight INSERT statements, and it's not clearly documented as "hey, guys, if you want to dump loads of data in, use COPY instead" (it might be that, I don't know, but usually COPY isn't directly transliterable with INSERT). I agree. Breathtaking. ChrisA