Scan descriptor
The scan descriptor, or MI_AM_SCAN_DESC structure, contains the specifications of an SQL query
The specifications of an SQL query from the scan descriptor
contain the following items:
- The columns to project
- A pointer to selection criteria from the WHERE clause
- Isolation and locking information
- A pointer to where the access method can store scanned data
The database server passes the scan descriptor to the access-method scanning purpose functions: am_beginscan, am_endscan, am_rescan, and am_getnext.
The following functions
extract information from the scan descriptor.
Accessor function | Return value |
---|---|
mi_scan_forupdate() | MI_TRUE if a SELECT statement includes a FOR UPDATE clause |
mi_scan_isolevel() | The isolation level for the table |
mi_scan_locktype() | The lock type for the scan |
mi_scan_newquals() | MI_TRUE if the qualification descriptor changes after the first scan for a join or subquery |
mi_scan_nprojs() | The number of columns in the projected row that the access method returns to the query |
mi_scan_projs() | A pointer to an array that identifies which columns from the row descriptor make up the projected row that the query returns |
mi_scan_quals() | A pointer to the qualification descriptor or a NULL-valued pointer if the database server does not create a qualification descriptor |
mi_scan_table() | A pointer to the table descriptor for the table that the access method scans |
mi_scan_userdata() | A pointer to the user-data area of memory |
The following accessor function sets data in the qualification
descriptor.
Accessor function | Value set |
---|---|
mi_scan_setuserdata() | The pointer to user data that a subsequent function will need |