User Guide > Data Ship Performance Optimization > Using Data Ship for Prepared Statements
 
Using Data Ship for Prepared Statements
If data ship has been enabled and a query is submitted using a prepared statement where the query is static but input variables can change, TDV evaluates it for data ship. For queries, TDV computes an execution plan. The execution plan considers data ship for each invocation of a prepared statement after the parameter values are known and presented to TDV.
For queries with prepared statements, the value of each parameter for a given execution is determined, the query is evaluated to build an execution plan, and data ship is considered. If TDV determines that data ship can be used to optimize the performance of the query, then TDV will process the query using data ship.
To use data ship for each invocation of a prepared statement
1. Define a table or view with a PreparedStatement.
2. Make sure that both the source and target data sources have data ship enabled.
3. Publish your table or view.
4. Run the queries containing the PreparedStatement.