Newer Version Available
Optimize Lists and Tables
Avoid Data Grids if Possible
Data grids are tables that display records with editable fields. Data grids frequently expand to thousands of input components on a page and exceed the maximum view state size. Large data grids result in a Visualforce component tree that processes slowly.
If your Visualforce page has a data grid:
- Use pagination and filters.
- To reduce the view state size, make data read-only where possible.
- Only display essential data for a given record. Provide a link to an Ajax-based details box or to a separate details page.
Consider Static HTML Tables
A Visualforce page with an iteration component such as <apex:pageBlockTable> can contain up to 1,000 items, or 10,000 items when the page is executed in read-only mode. However, page performance can sometimes decrease before this limit if <apex:pageBlockTable> contains an <apex:column> component with the rendered attribute explicitly specified.
If your Visualforce page has a large table, we recommend that you implement pagination. Alternatively, you can use a static HTML table instead of an <apex:pageBlockTable> component. Within the HTML table, use the <apex:repeat> component to iterate over an HTML row element. For an example HTML table that uses <apex:repeat>, see the apex:repeat component reference page.