Re: ECPG support for PQsetChunkedRowsMode()
| От | Daniel Verite |
|---|---|
| Тема | Re: ECPG support for PQsetChunkedRowsMode() |
| Дата | |
| Msg-id | d22379c8-7777-4ba1-9261-89ab5f5de2dd@manitou-mail.org обсуждение исходный текст |
| Ответ на | Re: ECPG support for PQsetChunkedRowsMode() (Tim Fors <tim4stheenchanter@gmail.com>) |
| Ответы |
Re: ECPG support for PQsetChunkedRowsMode()
|
| Список | pgsql-interfaces |
Tim Fors wrote: > Note that ECPG supports using a C array as a host variable, and in > that case there's a bulk transfer of rows from the client to the > server, so performance is much better than getting the rows one at a > time using a cursor. However, AFAIK this is not standard coding > practice - one expects to be able to use the cursor to FETCH one > row at a time, but still offer good performance. It's just a preprocessor. If the C code has EXEC SQL FETCH NEXT, it's going to emit code sending a FETCH NEXT [1] SQL statement. But aside from the arrays you mention, it allows retrieving several rows at a time through a cursor, so the client-side can still reduce the round-trips to the server. See this example in [2]: EXEC SQL FETCH 3 FROM mycursor INTO DESCRIPTOR mysqlda; [1]: https://www.postgresql.org/docs/current/sql-fetch.html [2]: https://www.postgresql.org/docs/current/ecpg-descriptors.html Best regards, -- Daniel Vérité https://postgresql.verite.pro/
В списке pgsql-interfaces по дате отправления: