Article ID: 300926 - Last Review: September 25, 2003 - Revision: 3.0 ACC2002: How to Optimize PivotTable List Performance in Microsoft AccessThis article was previously published under Q300926 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp). SUMMARY
To optimize PivotTable List performance in Microsoft Access, use the following tips, which are explained in detail in the "More Information" section:
MORE INFORMATIONHide Details in the PivotTable ListEven though PivotTable lists can display detail data, typically you should use PivotTable lists to display summary data and totals. The PivotTable component opens a separate ActiveX Data Objects (ADO) recordset for each cell it contains. When you use a PivotTable List to display details, there are typically many more cells displayed than if the details are hidden. Therefore, the PivotTable List must open and manage additional ADO recordsets, which contributes to slower performance.If you need to view detail data, design the PivotTable list so that details are hidden. Then you can drill down into the details for a specific row or column where the summary data is interesting. If you need to view details for all rows and columns, you should consider using another object to display the data, such as a query or a form. Unfortunately, the user interface of a PivotTable list usually requires that you view detail data before you add totals. The usual order of steps you would have to go through is:
NOTE: These steps assume that the PivotTable view is currently blank and has not been previously customized.
You can use these same steps to create a total that uses the Count aggregate function by selecting a non-numeric field in step 2. For example, if you select a text field, and then add it to the data axis by clicking Add, the PivotTable list will automatically create a total using the Count aggregate function. Use a Query to Restrict Unnecessary Fields and RecordsTry to reduce the number of fields and records used by the PivotTable component. You can do this by creating a query, a view, a stored procedure, or an inline function. Then, only select the fields necessary for the PivotTable list in the query's output, and use criteria, where possible, to reduce the number of records in the PivotTable list.This is important because Microsoft Access must retrieve the recordset from the underlying table or query, and then pass the recordset to the PivotTable component. The more data you have in this recordset the slower this operation is. This operation is faster if you eliminate unnecessary fields and records by using a query, and then opening the query in PivotTable view. This is especially important in a Microsoft Access project (.adp) file. When opening a SQL Server table in PivotTable view, Access must first retrieve all records for the table from the server and then download them to the client computer. Then, Microsoft Access passes the recordset to the PivotTable component. If you use criteria in a view, a stored procedure, or an inline function, the server only returns the rows requested and eliminates unnecessary network traffic. Calculate Detail Fields in a QueryEven though you can create calculated detail fields in a PivotTable list, it is usually faster to calculate them in a query, a view, a stored procedure, or an inline function. By using this approach, the database engine performs the calculation and includes the calculated field as part of the recordset it passes to the PivotTable component. Because the database engine has already calculated the value, you do not have to create a calculated field in the PivotTable component.Limit Use of Granular Date GroupingsTry to avoid the use of very granular date groupings in the PivotTable list. For example, try to avoid using hours, minutes, and seconds. If you need to group on a particular portion of a date, create an expression in a query that extracts the portion that you need. For example, you can use the DatePart function in a query or a view to extract the portion of the date that you need. After you have extracted the date portions that you need, you can add these as fields to a particular axis. This allows you to group by the date portion without having the PivotTable component calculate the date portions.REFERENCESFor additional information about optimizing performance when you print PivotTables, click the article number below
to view the article in the Microsoft Knowledge Base:
282315
(http://support.microsoft.com/kb/282315/EN-US/
)
ACC2002: Access Appears to Hang When You Preview or Print an Object in PivotTable View
| Article Translations
|
Back to the top
