Limiting the Number of Fields Selected

To limit the amount of data traveling across a network, limit the number of fields you select from the database. Although SELECT * is quick and easy to type, it may not be quick and easy for the network to return all the data. For example, consider a table with fifteen fields, one being an integer key value, and the rest being Memo and Text fields. If you are interested only in the key value, select only that field. Otherwise, your application will be subject to a performance penalty caused by retrieving unnecessary fields.

The BookSales and BookSalesOptimized sample applications don’t apply the technique of limiting fields because almost all the fields in the tables are necessary. Also, because there are no Memo or Long Binary (OLE Object) fields that could potentially slow down the application, there is no need to exclude such fields. However, if the tables used by your application have many fields, consider retrieving just the few you need to display. If the user needs to see more detailed information in a different context, your application can request additional fields using a separate query.