The invention discloses a
database query method and
system, and relates to the technical field of databases. The method of the embodiment of the invention comprises the following steps: receiving a
database query request; judging whether the request is a primary request or not; if the request is the primary request, executing a corresponding
database query operation, and storing a query result into a cache; and if the request is not the primary request, obtaining the query result of the
database query request in the cache. When the same SQLs simultaneously query the database, the SQLs only query one time and return a result, other requests obtain the result of the first request, i.e., under a certain condition, only first-time
SQL language query takes effect within a period of time, and the rest waits for the query result. Multiple-time
SQL requests are compressed into one-time
SQL request, the burden of the database can be lightened so as to solve the technical problem of database congestion caused by the multiple-time database requests, the
result set returning speed of SQL query can be improved, the
result set which is subsequently requested to use is the
result set which is requested the first time, and query time is greatly shortened.