Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Fast execution of SQL queries
"F?ix" <fgaitero_at_e-netfinger.com> wrote in message news:<9no4os$bj3$1_at_talia.mad.ttd.net>...
> Hello, I'd like to know if there is a way
> to know the time of execution of a SQL query
> because I'm creating indexes and I want to
> know if they're going to be more efficient than not
> to use them in some queries.
> Thanks
From SQL*Plus you can use the timing command: set timing on Once you do this you will get the elapsed time for every SQL statement ran in the session.
There is also a set time command that will display the time, but why manually calculate the difference.
Inside pl/sql code you can select the time before and after SQL and calculate the difference.
You would need to run the test before adding the indexes, and then run the same SQL after adding the indexes. Do not forget to analyze after adding the indexes before running the tests.
![]() |
![]() |