Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #104393
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | INADA Naoki <songofacandy@gmail.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: Review Request of Python Code |
| Date | Wed, 9 Mar 2016 16:52:41 +0900 |
| Lines | 23 |
| Message-ID | <mailman.70.1457509983.15725.python-list@python.org> (permalink) |
| References | <f0973a0d-62ba-402b-ab23-cb68bdd15323@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| X-Trace | news.uni-berlin.de CoW7QmpsdDhaNKB6AnQ/rA6sj77Co46eNHm820A5CCug== |
| Return-Path | <songofacandy@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'subject:Python': 0.05; 'cc:addr:python-list': 0.09; 'cursor': 0.09; 'url:github': 0.09; 'python': 0.10; '--\xc2\xa0': 0.16; 'fetches': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'row': 0.16; 'memory': 0.17; 'email addr:gmail.com>': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'object.': 0.22; 'subject:Code': 0.22; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'message-id:@mail.gmail.com': 0.27; 'consumption': 0.29; 'convert': 0.29; 'class.': 0.30; 'saves': 0.30; "can't": 0.32; 'server': 0.34; 'received:google.com': 0.35; 'received:209.85': 0.36; '(and': 0.36; 'subject:: ': 0.37; 'client': 0.37; 'release': 0.37; 'received:209': 0.38; 'some': 0.40; 'default': 0.61; 'side': 0.62; 'url:master': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fno+lnXjXhzI+L+3JQy2WBoyt6s3DkfYUcSASOpObzI=; b=zPiV7vRD26eSqdtKqwUvolFQ29heoifuhhJrvfnHh+8nmMLy0XBC6nBINipMK/feWG zeUUSlqcH9f7rB+BVv82PqiJjr2Ux8hbCEbnX1upnt3KeXfD4jkMK4FFfSt42x8Fk8CV 1xfB7e0P6sM9eQTERi7vge+TAz9BWi2OBTYUub2e7Om2/+CbjiEC6J38pSgNdvrWwY++ PK36xIY/LRVxrCz8Ok2mJaqYnHna6M7DpDyq0FtsgbcdMajdOCYYrEiChVBwgS2FwPLN GbRHSw8D1ul6qWK+U3+DWfv66RW4YuaiExgWVJrSKNHeO5peOX46XRVt9WTJF0B30cIz w7lg== |
| X-Google-DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fno+lnXjXhzI+L+3JQy2WBoyt6s3DkfYUcSASOpObzI=; b=fUFTrR5dp8MTkYLf9Zb4JVrwRSmJZyhZJDB/ybtYr4IOHkuZx5tvj0/NJxkmJgWsG5 UFtdj/7QqBoUMW9gvRd/hJy6AfU937YN8JYrvzWM6fMa8SF+cziRJrHnPMkxVBTqMXvM T+rd3mLH73kbhQfuJTplNWo4lfhLYd3zzSXPtCTictZ+dX5iVq/AaehgbDBDTNYhqz3R D38STC+ttpkAaqOmHdgiH+4Orbz9vUz65GQ9lZ5yj1KVL24nT+J4gYGe23k+JeoZ2ly3 IqYVl55hRP58+mPHrLxntzmC78RaI4edrNCgJOs/XA5smAthNggJ1H284WPNcZE2t+jv 0B/g== |
| X-Gm-Message-State | AD7BkJJSe11uKE1hVPqR5sdge3ezdidKCaMtvKExRsuCQ7v7InD5zbhH+BScaJRvStEpkqGBUd+GkgerBBidyQ== |
| X-Received | by 10.107.8.30 with SMTP id 30mr12296598ioi.60.1457509980599; Tue, 08 Mar 2016 23:53:00 -0800 (PST) |
| In-Reply-To | <f0973a0d-62ba-402b-ab23-cb68bdd15323@googlegroups.com> |
| X-Content-Filtered-By | Mailman/MimeDel 2.1.21 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:104393 |
Show key headers only | View raw
While MySQL doesn't have server side cursor, MySQLdb has SSCursor class.
https://github.com/PyMySQL/mysqlclient-python/blob/master/MySQLdb/cursors.py#L551
Default cursor fetches MySQL response at once and convert them into Python
object.
SSCursor fetches MySQL response row by row. So it saves Python memory
consumption (and
MySQL server can't release some resource until client fetches all rows.)
To use SScursor:
cur = db.cursor()
>
cur = db.cursor(MySQLdb.cursors.SSCursor)
for row in cur.fetchall():
>
for row in cur:
--
INADA Naoki <songofacandy@gmail.com>
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Review Request of Python Code subhabangalore@gmail.com - 2016-03-08 20:18 -0800
Re: Review Request of Python Code Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-09 16:10 +1100
Re: Review Request of Python Code INADA Naoki <songofacandy@gmail.com> - 2016-03-09 16:52 +0900
Re: Review Request of Python Code Friedrich Rentsch <anthra.norell@bluewin.ch> - 2016-03-09 10:06 +0100
Re: Review Request of Python Code Matt Wheeler <m@funkyhat.org> - 2016-03-09 12:06 +0000
Re: Review Request of Python Code Matt Wheeler <m@funkyhat.org> - 2016-03-09 12:33 +0000
Re: Review Request of Python Code subhabangalore@gmail.com - 2016-03-10 10:12 -0800
Re: Review Request of Python Code BartC <bc@freeuk.com> - 2016-03-10 18:36 +0000
Re: Review Request of Python Code Matt Wheeler <m@funkyhat.org> - 2016-03-10 18:51 +0000
Re: Review Request of Python Code subhabangalore@gmail.com - 2016-03-10 12:14 -0800
RE: Review Request of Python Code Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-03-10 19:12 +0000
Re: Review Request of Python Code Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-10 19:56 +0000
csiph-web