Get execution time of PostgreSQL query

前端 未结 3 1261
一生所求
一生所求 2020-12-23 13:28
DECLARE @StartTime datetime,@EndTime datetime

SELECT @StartTime=GETDATE()

select distinct born_on.name
from   born_on,died_on
where (FLOOR((\'2012-01-30\'-born_on.         


        
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-23 13:46

    If you mean in psql, rather than some program you are writing, use \? for the help, and see:

    \timing [on|off]       toggle timing of commands (currently off)
    

    And then you get output like:

    # \timing on
    Timing is on.
    
    # select 1234;        
     ?column? 
    ----------
         1234
    (1 row)
    
    Time: 0.203 ms
    

提交回复
热议问题