January 2019
Beginner
556 pages
14h 19m
English
Here's an important question regarding a database system: how fast is it? How many transactions can it handle per second, and how much time does a particular query take to execute? The performance of a database was covered in Chapter 13, Optimizing Database Performance. Here, we will only discuss the task of measuring it.
The psql meta-command, \timing, is used to measure the time of execution of a particular SQL command. Once timing is enabled, psql shows the execution time for each command:
car_portal=> \timingTiming is on.car_portal=# SELECT count(*) FROM car_portal_app.car; count------- 229(1 row)Time: 0.643 ms
Usually, that is enough to understand which query is faster and whether you are on the right way when working ...
Read now
Unlock full access