# Learning Background Of Aggregation Operation Case

+ statistical statement
+ Execution plan


![left](./student-guide/diagram/01-31-1.png)

```
SELECT count(*) FROM t1 WHERE dt > '2021-11-25 20:39:58'; 
```

------------------------------------------------------------


Our online databases often encounter the need to perform aggregation operations such as count on database records. Let's take a look at how to tune and solve these SQL performance problems.

Specific case

We have a t1 table with the following table schema:
```
CREATE TABLE t1 (
 id int(11) NOT NULL AUTO_INCREMENT,
 orderid int(11) NOT NULL,
 addr int(11) NOT NULL,
 dt datetime NOT NULL,
 PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
```

We need to count the number of records from a certain point in time until now:

```
SELECT count(*) FROM t1 WHERE dt > '2021-11-25 20:39:58'; 
```

Let's take a look at the implementation plan:

(omitted)
