Performance Problems when selecting HUGE amounts of data from MySQL dbs

Skip Montanaro skip at
Wed Jan 9 10:45:45 EST 2002

    Gabriel> db.execute("SELECT myfield FROM table")
    Gabriel> data=db.fetchall()
    Gabriel> giantstring=""
    Gabriel> for record in data:
    Gabriel>     giantstring+=record

    Gabriel> but this is way too slow.

How about

    db.execute("SELECT myfield FROM table")
    for record in data:
    giantstring = "".join(giantstring)

Skip Montanaro (skip at -

More information about the Python-list mailing list