---
schema_version: "1"
id: 56cb5365010b382f125ded0578b0b4237fd676024ef30d22d25f1480f5d9153d
title: Working with Large Sets of Data
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/controller/pages-controller-readonly-context.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-readonly-context.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bf47e5d2d738ff4fd7543f8e8578fd6505f8802a481481b274c939bf3e893c9e
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Working with Large Sets of Data

Visualforce custom controllers and controller extensions are subject to Apex governor limits. For more information about governor limits. Additionally, Visualforce iteration components, such as `<apex:pageBlockTable>` and `<apex:repeat>`, are limited to a maximum of 1,000 items in the collection they iterate over.

Sometimes your Visualforce pages may need to work with or display larger sets of data, but not need to make modifications to that data; for example, if you are providing custom reporting and analytics. Visualforce offers developers a “read-only mode”, which relaxes the limit on the number of rows which can be queried in one request, and increases the limit on the number of collection items which can be iterated over within the page.

You can specify read-only mode either for an entire page or, with certain limitations, on individual components or methods.

**note:** You can only iterate over large sets of data if you specify read-only mode for the entire page.

-   **[Setting Read-Only Mode for an Entire Page](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-readonly-context-pagelevel.md)**  


    To enable read-only mode for an entire page, set the `readOnly` attribute on the `<apex:page>` component to `true`.

-   **[Setting Read-Only Mode for Controller Methods](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-controller-readonly-context-methodlevel.md)**  


    Visualforce controller methods can, with some important limitations, use the Apex `ReadOnly` annotation, even if the page itself isn’t in read-only mode.


