A method of optimizing a database system, comprising: S1, snapshotting performance data of each Structured Query Language sentence of the database system every preset first time, and arranging and storing snapshots according to a time sequence, wherein the performance data include the number of times of executions and a volume of data of buffer gets; characterized in that the method further comprises: S2, correspondingly carrying out calculation on the performance data of the current snapshot and the performance data of the former snapshot respectively to calculate a total volume of data of buffer gets and an average volume of data of buffer gets in a single-execution corresponding to each SQL sentence within the preset first time, wherein the average volume of data of buffer gets in a single-execution is equal to the total volume of data buffer gets corresponding to the SQL sentence divided the number of times the SQL sentence was executed within the preset first time; S3, obtaining a sum of the total volume of data of buffer gets and the average volume of data of buffer gets in the single-execution of each SQL sentence, and selecting an SQL sentence to be optimized on the basis of the sum; wherein after the step S2, the method comprises: S201, analyzing whether the average volume of data of buffer gets in the single-execution corresponding to the each SQL sentence is less than or equal to a preset data volume or not; S202, if YES, filtering out SQL sentences with the average volume of data of buffer gets in the single-execution less than or equal to the preset data volume, and selecting SQL sentences with the average volume of data of buffer gets in the single-execution greater than the preset data volume as the SQL sentences for executing the step S3. wherein the step S2 further comprises: obtaining a sum of the total volume of data of buffer gets for all the SQL sentences within the preset first time; obtaining a ratio of the total volume of data of buffer gets corresponding to each SQL sentence to the sum of the total volume of data of buffer gets for all the SQL sentences; selecting the SQL sentence with the ratio greater than a preset ratio as an SQL sentence for executing the step S3. S2, correspondingly carrying out calculation on the performance data of the current snapshot and the performance data of the former snapshot respectively to calculate a total volume of data of buffer gets and an average volume of data of buffer gets in a single-execution corresponding to each SQL sentence within the preset first time, wherein the average volume of data of buffer gets in a single-execution is equal to the total volume of data buffer gets corresponding to the SQL sentence divided the number of times the SQL sentence was executed within the preset first time; S3, obtaining a sum of the total volume of data of buffer gets and the average volume of data of buffer gets in the single-execution of each SQL sentence, and selecting an SQL sentence to be optimized on the basis of the sum; S201, analyzing whether the average volume of data of buffer gets in the single-execution corresponding to the each SQL sentence is less than or equal to a preset data volume or not; S202, if YES, filtering out SQL sentences with the average volume of data of buffer gets in the single-execution less than or equal to the preset data volume, and selecting SQL sentences with the average volume of data of buffer gets in the single-execution greater than the preset data volume as the SQL sentences for executing the step S3. obtaining a sum of the total volume of data of buffer gets for all the SQL sentences within the preset first time; obtaining a ratio of the total volume of data of buffer gets corresponding to each SQL sentence to the sum of the total volume of data of buffer gets for all the SQL sentences; selecting the SQL sentence with the ratio greater than a preset ratio as an SQL sentence for executing the step S3.