I am using python-mysql (MySQLdb) to query the Mysql server. There are two cursor modules: one is the client cursor, for example:
cursor = db.cursor(MySQLdb.cursors.DictCursor)
Another is a server-side cursor, for example:
cursor = db.cursor(MySQLdb.cursors.SSDictCursor)
Doc says a server-side cursor means that Mysql caches some results on the server side of mysql and then sends them to the client. I'm so confused about this, let's say if I want to kill one mysql server, I could just use a few server side cursors and then mysql will be dead due to out of memory. Also, does the server size cursor make sense? The default mechanism of Mysql is that when mysql retrieves a single record, it immediately sends it to the client. Does it make sense to cache the results and then send them?
I really don't know which cursor I should use, the server side cursor or cursor?
source
share