memory - How MySQL client and PDO receive big result with fetch method -


if had big table (1m rows)

i send select * table (without limit, ...)

  • i use pdo prepared query
  • i fetch result only one pdo::fetch method (not fetchall)

what happens @ mysql communication layer?

1) mysql server send rows mysql client , mysql client send first row php? (so lot of memory used on php server , mysql server)

2) mysql client fetch 1 row on network mysql server? (so lot of memory used on mysql server only)

(php 5.3.3 , libmysqlclient1.6)

it depends on buffering mode choose , mysql client version. in case data used in mysql server side.

buffered , unbuffered queries


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -