> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/advanced-topics-pentaho-data-integration-overview/pentaho-data-services/optimize-a-pentaho-data-service/apply-a-query-pushdown-optimization/add-the-query-pushdown-parameter-to-the-table-input-or-mongodb-input-steps.md).

# Add the query pushdown parameter to the Table Input or MongoDB Input steps

The input step allows you to query the data source. These instructions explain how to add a parameter that will act as a `WHERE` clause in the SQL query or the equivalent type of clause in the MongoDB query.

1. [Create a transformation](/pdia-data-integration/9.3-data-integration/data-integration-perspective-in-the-pdi-client/work-with-transformations-cp/create-a-transformation.md) that has a Table Input or MongoDB Input step.
2. [Run your transformation](/pdia-data-integration/9.3-data-integration/data-integration-perspective-in-the-pdi-client/work-with-transformations-cp/run-your-transformation.md) to ensure it executes properly.
3. Double-click the input step (Table Input or MongoDB Input) that contains the query you want to optimize.
4. Add a parameter to the location of the `WHERE` clause value, like this:
   * SQL Query Example: `SELECT * FROM media WHERE ${countryParam}`
   * MongoDB Query Example: `{$match : ${mongoDbParam}}`
5. Press CTRL SPACE to view the list of parameters. Click on a parameter from the list to add it to the query.
6. Select the **Replace Variables in Script?** checkbox.
7. Click the **OK** button.
8. [Set up the Query Pushdown Parameter Optimization](/pdia-data-integration/9.3-data-integration/advanced-topics-pentaho-data-integration-overview/pentaho-data-services/optimize-a-pentaho-data-service/apply-a-query-pushdown-optimization/set-up-query-pushdown-parameter-optimization.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/advanced-topics-pentaho-data-integration-overview/pentaho-data-services/optimize-a-pentaho-data-service/apply-a-query-pushdown-optimization/add-the-query-pushdown-parameter-to-the-table-input-or-mongodb-input-steps.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
