Re: Oracle timediff function

From: Andrew Kerber <>
Date: Sun, 14 Feb 2016 12:31:05 -0600
Message-Id: <>

If you are diffing timestamps, here is what I came up with after extensive help from this list:

Sent from my iPad

> On Feb 14, 2016, at 12:25 PM, MJ Chicago <> wrote:
> Hello Oracle-L
> Is anyone familiar if Oracle has a timediff function to calculate
> difference in time (seconds/milliseconds/etc) in
> I have an app query where a table is joined onto itself to do this
> manually. Overall performance has been very choppy. The table has
> under 400,000 rows in it with up-to-date stats.
> I am testing a rewrite and tuning outside a package. End goal is this
> would end up in a cursor.
> Ran ADDM, increased SGA. Ran SQL Advisor, added recommended indexes.
> Ran SQL Tuning Advisor, added recommended function-based index.
> Explain plan shows index range scan under CBO. I have yet to run the
> same with /*+ RULE */ hint.
> I am asking two questions here:
> a) compute timediff without having to join table onto itself
> b) any additional recommendation to generally improve query performance
> Any suggestions or ideas are greatly appreciated.
> Thank you in advance
> MJ
> --

Received on Sun Feb 14 2016 - 19:31:05 CET

Original text of this message