Split a scan
The way in which you split a scan influences the ability of the access method to optimize performance during queries.
- am_beginscan
Identify the columns to project and the strategy function to execute for each WHERE clause qualification. The database server calls the function for am_beginscan only once per query.
- am_getnext
Scan through the index to find a qualifying entry and return it. The database server calls this function as often as necessary to exhaust the qualified entries in the index.
- am_rescan
Reuse the information from am_beginscan and possibly some data from am_getnext to perform any subsequent scans for a join or subquery.
- am_endscan
Deallocate any memory that am_beginscan allocates. The database server calls this function only once.
If you provide only an am_getnext purpose function, that one purpose function (and any UDRs that it calls) analyzes the query, scans, rescans, and performs end-of-query cleanup.