Because of having to be opening and closing database connection memory consumption goes up? I would like to know if I use an open connection at all times, I will have the advantage of decreasing memory consumption.
import MySQLdb
dblocal = MySQLdb.connect("host",
"user",
"password",
"db")
cursor = dblocal.cursor()
cursor.execute("SELECT * FROM ("tabela")
recordsdblocal = cursor.fetchall()
If it is possible and feasible how can I do this?