# Enabling `TiFlash MPP` for Query

```
SET @@session.~!@tidb_allow_mpp@!~=1;
SET @@session.~!@tidb_enforce_mpp@!~=1;
```

```
ALTER TABLE salaries SET ~!@TIFLASH REPLICA@!~ 1;
ALTER TABLE employees SET ~!@TIFLASH REPLICA@!~ 1;
```

------------------------------------------------------------------------------
First, the TiDB Server's optimizer determines whether to utilize the MPP architecture. To ensure SQL statements use the MPP architecture, configure the system variables as follows:

```
SET @@session.tidb_allow_mpp = 1;
SET @@session.tidb_enforce_mpp = 1;
```

Additionally, the tables must have columnar replicas on TiFlash. To add these columnar replicas, use the following commands:

```
ALTER TABLE salaries SET TIFLASH REPLICA 1;
ALTER TABLE employees SET TIFLASH REPLICA 1;
```