pgsql: Provide vectored variants of smgrread() and smgrwrite().

2023-12-17 Thread Thomas Munro
Provide vectored variants of smgrread() and smgrwrite().

smgrreadv() and smgrwritev() and their md.c implementations call
FileReadV() and FileWriteV().  A range of disk blocks beginning at
'blocknum' and extending for 'nblocks' can be scattered to or gathered
from multiple buffers with a single system call.  The traditional
smgrread() and smgrwrite() functions are implemented in terms of the new
functions.

Later commits will introduce calls with nblocks > 1, but the following
behavioral changes can be seen already:

* After a short transfer we'll now retry until we eventually read 0
  bytes (= EOF) or get ENOSPC, EDQUOT, EFBIG etc, where previously we
  would infer the reason.  Retrying is consistent with xlog.c's
  treatment of large WAL writes, and arguably also xlog.c and fd.c's
  treatment of EINTR.  Arbitrary short returns for larger transfers have
  been observed on several OSes, and might in theory also happen for
  transient reasons with our own pg_p*v() fallback code.

* After unexpected EOF or -1, the error thrown now talks about
  a range even for the single block case, eg "blocks 42..42".

Reviewed-by: Heikki Linnakangas 
Discussion: 
https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6ut5tum2g...@mail.gmail.com

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/4908c5872059c409aa647bcde758dfeffe07996e

Modified Files
--
doc/src/sgml/monitoring.sgml|   4 +-
src/backend/storage/smgr/md.c   | 325 
src/backend/storage/smgr/smgr.c |  37 ++---
src/include/storage/md.h|   9 +-
src/include/storage/smgr.h  |  25 +++-
5 files changed, 279 insertions(+), 121 deletions(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
REL_13_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/b4c147ac6fd5238d2c49b6369d555f29dbfc9144

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
REL_14_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/7a4bdd986ab9a10f3bc2d8875be6e154b63a1918

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
REL_16_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/8b9d39254816195abb55ab204e39f8fa476aad23

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
REL_12_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/499342e81b0fba471889439e47e0c37fe9e62bc0

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
master

Details
---
https://git.postgresql.org/pg/commitdiff/b7412e293b6b3bf9dd02596d6f6be456a0597d58

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)



pgsql: Doc: add a bit to indices.sgml about what is an indexable clause

2023-12-17 Thread Tom Lane
Doc: add a bit to indices.sgml about what is an indexable clause.

We didn't explain this clearly until somewhere deep in the
"Extending SQL" chapter, but really it ought to be mentioned
in the introductory material too.

Discussion: https://postgr.es/m/4097442.1694967...@sss.pgh.pa.us

Branch
--
REL_15_STABLE

Details
---
https://git.postgresql.org/pg/commitdiff/afc987e196107b0887314838256a885af05b8714

Modified Files
--
doc/src/sgml/indices.sgml | 35 ++-
1 file changed, 34 insertions(+), 1 deletion(-)