*** pgsql/doc/src/sgml/indexam.sgml 2007/04/06 22:33:41 2.23 --- pgsql/doc/src/sgml/indexam.sgml 2008/04/10 22:25:25 2.24 *************** *** 1,4 **** ! Index Access Method Interface Definition --- 1,4 ---- ! Index Access Method Interface Definition *************** amgettuple (IndexScanDesc scan, *** 320,342 **** ! boolean ! amgetmulti (IndexScanDesc scan, ! ItemPointer tids, ! int32 max_tids, ! int32 *returned_tids); ! ! Fetch multiple tuples in the given scan. Returns TRUE if the scan should ! continue, FALSE if no matching tuples remain. tids points to ! a caller-supplied array of max_tids ! ItemPointerData records, which the call fills with TIDs of ! matching tuples. *returned_tids is set to the number of TIDs ! actually returned. This can be less than max_tids, or even ! zero, even when the return value is TRUE. (This provision allows the ! access method to choose the most efficient stopping points in its scan, ! for example index page boundaries.) amgetmulti and amgettuple cannot be used in the same index scan; there ! are other restrictions too when using amgetmulti, as explained in . --- 320,335 ---- ! int64 ! amgetbitmap (IndexScanDesc scan, ! TIDBitmap *tbm); ! ! Fetch all tuples in the given scan and add them to the caller-supplied ! TIDBitmap (that is, OR the set of tuple IDs into whatever set is already ! in the bitmap). The number of tuples fetched is returned. ! amgetbitmap and amgettuple cannot be used in the same index scan; there ! are other restrictions too when using amgetbitmap, as explained in . *************** amrestrpos (IndexScanDesc scan); *** 491,510 **** Instead of using amgettuple, an index scan can be done with ! amgetmulti to fetch multiple tuples per call. This can be noticeably more efficient than amgettuple because it allows avoiding lock/unlock cycles within the access method. In principle ! amgetmulti should have the same effects as repeated amgettuple calls, but we impose several restrictions to ! simplify matters. In the first place, amgetmulti does not ! take a direction argument, and therefore it does not support ! backwards scan nor intrascan reversal of direction. The access method ! need not support marking or restoring scan positions during an ! amgetmulti scan, either. (These restrictions cost little ! since it would be difficult to use these features in an ! amgetmulti scan anyway: adjusting the caller's buffered ! list of TIDs would be complex.) Finally, amgetmulti does ! not guarantee any locking of the returned tuples, with implications spelled out in . --- 484,500 ---- Instead of using amgettuple, an index scan can be done with ! amgetbitmap to fetch all tuples in one call. This can be noticeably more efficient than amgettuple because it allows avoiding lock/unlock cycles within the access method. In principle ! amgetbitmap should have the same effects as repeated amgettuple calls, but we impose several restrictions to ! simplify matters. First of all, amgetbitmap returns all ! tuples at once and marking or restoring scan positions isn't ! supported. Secondly, the tuples are returned in a bitmap which doesn't ! have any specific ordering, which is why amgetbitmap doesn't ! take a direction argument. Finally, amgetbitmap ! does not guarantee any locking of the returned tuples, with implications spelled out in . *************** amrestrpos (IndexScanDesc scan); *** 605,613 **** ! In an amgetmulti index scan, the access method need not ! guarantee to keep an index pin on any of the returned tuples. (It would be ! impractical to pin more than the last one anyway.) Therefore it is only safe to use such scans with MVCC-compliant snapshots. --- 595,602 ---- ! In an amgetbitmap index scan, the access method does not ! keep an index pin on any of the returned tuples. Therefore it is only safe to use such scans with MVCC-compliant snapshots.