---
schema_version: "1"
id: b0cdbd7e907fd28c42be7d42a1b0e16dcf2fa8fe14b35395f8084ac50bf5c1c1
title: Retrieve Query Plans
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforcedx/sfvscode/guides/programming-languages/soql/soql-plans.md
canonical_url: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/soql-plans.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6d14ab0037cda0e2fef1fbfdf5ab130791b6ad08e22a5a8469b1909286910ede
products:
  - Salesforce Extensions for Visual Studio Code
  - salesforcedx
---
# Retrieve Query Plans

Use the Query Plan tool to view, optimize, and speed up SOQL queries on large datasets.

You can retrieve a query plan for a query by using one of these methods. The query plan shows each operation and its cost. The output panel shows all the available notes for your highest ranked query plan, which is the query plan currently in use.
You can view the query plan from the SOQL Builder and from the text editor. The plan opens in the _Output_ tab.

- Open a query in the SOQL query builder and click **Get Query Plan**.

  ![The query plan shows in the SOQL Query Builder](https://developer.salesforce.com/docs/platform/media/shared/query_plan_tool.png '{"class": "image-lg image-framed"}')

- Open a query in the text editor and click the **Get Query Plan** text preceding the query text.

  ![Get query plan from the text editor](https://developer.salesforce.com/docs/platform/media/shared/query_plan_text2.png '{"class": "image-md image-framed"}')

