postgresql - optimization with postgres cursor in php -


i'm dealing big volumes of data. it's huge table i'm performing unions through sql statement, php, , sending on own localhost db. i've got thing sorted out want optimize this. had stay overnight merging around 83.000 rows.

    $con = new pdo("pgsql:host, port,dbname, user, password");     $con->begintransaction(); // cursors require transaction.     $stmt = $con->prepare($query);     $stmt->execute();     $innerstatement = $con->prepare("fetch 1 cursor1");     while($innerstatement->execute() && $row = $innerstatement->fetch(pdo::fetch_assoc)) {         insertdatatodb($row);     } 

question: changing line "fetch 1000 cursor1" make i'm fetching 1000 rows each time instead of one? performance? i'm hoping larger operation 1 time thing. in future have move smaller amounts of data... still query rather heavy since relies in comparisons timestamps, otherwise how know if db updated or not?

thank you.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -