Max_Rows_Fetched

The number of rows to limit a result to.

Supported By

SQL Drivers (SQL Server, DB2 and ODBC)

Value

0 ..

Associated Attribute

DF_FILE_MAX_ROWS_FETCHED (Positive integer)

Remarks

The number of records result sets of find operations on this table should be limited to. The default value is 0 (zero), which means that result sets will not be limited. All other positive integer values will limit the result set to that value.

Database servers use the SQL language to manipulate data. SQL is a set oriented language. Every statement works on set(s) and results in a set. A DataFlex find command will be translated into its SQL counterpart, which is sent to the database server. The SQL statement will result in a set of rows that satisfy the condition of the statement for the find command. This result set can have no, one or more rows. In some cases, a result set will contain all rows of a table.

Limiting the result set can improve performance. Unfortunately, there is no rule that can be followed when using this attribute. The best setting for the attribute depends on the program logic and may vary in different functional areas in one program. Normally, the best settings to use when experimenting with values for this attribute are 0, 1 and the number of records that are shown on the screen (in lists).

The DataFlex SQL Server Driver uses dynamic cursors for its find logic – it is one of the server side cursors supported by Microsoft SQL Server. In general, a setting of zero (0) will provide the best performance. For more information about cursors, see the SQL Server documentation.

The DataFlex DB2 Driver uses forward only cursors for its find logic. The database server handles a forward only cursor and is one of the cursors supported by DB2. In general, a setting of zero (0) will provide the best performance. For more information about cursors, see the DB2 documentation.

 

The default setting is used when creating tables, the value is included in each [table.]INT file.

So, the value of the DEFAULT_MAX_ROWS keyword set in the [database.]INT will be used as the initial value for the keyword MAX_ROWS_FETCHED in the [table.]INT when each table is created. The value of the MAX_ROWS_FETCH keyword in the INT file will be used in SELECTs that are generated for FINDs performed against the tables.

  See Also

Table Keywords