# Ignore the `DEALLOCATE PREPARE`
+ To reduce the syntax parsing cost of the SQL statement within the same session
+ Option A:
  + Use **`DEALLOCATE PREPARE`** (server side) and **`$stmt->close()`** or **`$stmt->closeCursor()`** (protocol) sparingly
+ Option B:
  + Ignore the commands to deallocate the prepared statement from the plan cache
  + Set **`tidb_ignore_prepared_cache_close_stmt`** system variable to `1` in your session

```
tidb> SET ~!@tidb_ignore_prepared_cache_close_stmt@!~=1;
Query OK, 0 rows affected (0.00 sec)

tidb> SELECT @@tidb_ignore_prepared_cache_close_stmt;
+-----------------------------------------+
| @@tidb_ignore_prepared_cache_close_stmt |
+-----------------------------------------+
|                                       1 |
+-----------------------------------------+
1 row in set (0.00 sec)
```
--------------------------------------------------------------------------------

To reduce the syntax parsing cost of SQL statements, it is recommended that you run prepare statement once, then execute statement multiple times before running deallocate prepare.

We will discuss `$stmt` shortly, it's returned by `prepare()` from a `PDO` object `(PDO_MySQL)` or `mysqli` instance `(mysqli)`.

For more information please refer: https://docs.pingcap.com/tidb/dev/sql-prepared-plan-cache