start time and end time for a query is same which takes 25 seconds to get execute.

In a file called query.sql, i have kept a query which takes around 25 to 90 sec's to get complete. Before and after the query i have kept select now();
But I am getting same time(result) for both the select now().

Ex:
select now();

select statement which runs for 25 -90 sec's

Select now();


Output
---------
Timing is on.             
c1
-------------------------------
 2014-06-09 08:58:25.449612-04
(1 row)

Time: First fetch (1 row): 16.637 ms. All rows formatted: 16.680 ms

 GENDER_CODE | GENDER  |  C548   |       C549       |   C65   |        C3
-------------+---------+---------+------------------+---------+------------------
 02          | MALE    |  948583 | 19820794210.3239 |  948583 | 18753529074.2442
 03          | UNKNOWN |  699106 | 13843051800.4582 |  699106 | 13102890661.4551
 01          | FEMALE  | 2579452 | 54830989697.9887 | 2579452 | 51887346055.0932
(3 rows)

Time: First fetch (3 rows): 90961.453 ms. All rows formatted: 90961.521 ms
              c2
-------------------------------
 2014-06-09 08:58:25.449612-04
(1 row)

Any idea why it is so?

Regards
--Noor

Comments

  • Hi Noor,
    you should use getdate() instead of now(). now() returns the start time of the current transaction, which will be the same in this as all your statements running from the query.sql file are in the same Vertica session/ transaction.

    /Sajan
  • Thank you Sajan,

    It workzzzzzzz.

    Regards
    --Noor

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file