Get status of a long running insert ...

Moderator: NorbertKrupa

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: Get status of a long running insert ...

Post by NorbertKrupa » Mon Feb 17, 2014 2:12 pm

Did I miss where OP posted they are using 7? Were you able test out dc_load_events?
Checkout vertica.tips for more Vertica resources.

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: Get status of a long running insert ...

Post by id10t » Mon Feb 17, 2014 2:19 pm

Hi!

[DELETED]
Last edited by id10t on Fri May 08, 2015 4:40 pm, edited 1 time in total.

Brett
Beginner
Beginner
Posts: 49
Joined: Fri Oct 11, 2013 1:19 am

Re: Get status of a long running insert ...

Post by Brett » Wed Feb 19, 2014 1:41 pm

Thanks for the great feedback! I am using Vertica 7 by the way... I will try some of the suggestions provided and will post my findings :)

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Get status of a long running insert ...

Post by JimKnicely » Wed Apr 16, 2014 11:15 pm

Hi,

I have a long running insert using the /*+ DIRECT */ hint.

I believe that I I can monitor the progress of it by querying the EXECUTION_ENGINE_PROFILES table...

Code: Select all

vertica=> SELECT counter_name, MAX(counter_value), MIN(counter_value) 
vertica->   FROM execution_engine_profiles 
vertica->  WHERE counter_name ILIKE '%sort%' 
vertica->     OR counter_name ILIKE '%clock%' 
vertica->     OR counter_name ILIKE '%estimated%' 
vertica->    AND session_id = 'verticadb01.u-28326:0x178b'
vertica->  GROUP BY counter_name 
vertica->  ORDER BY counter_name;
      counter_name       |    MAX     |    MIN     
-------------------------+------------+------------
 clock time (us)         | 4083970253 |          0
 estimated rows produced | 2319448203 | 2319448203
 rows output by sort     |  372360617 |          0
(3 rows)
In the example, when the MAX and MIN values of the “rows output by sort” = the “estimated rows produced”, the INSERT will be done!
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Get status of a long running insert ...

Post by scutter » Thu Apr 17, 2014 3:30 pm

The “estimated rows produced” are just estimates - they are what shows up in the EXPLAIN output and there’s no guarantee that they match reality. When you’re deep into the sort phase of the INSERT, other lower operators will have completed, and you should be able to use “rows produced” for a completed operator. I think there may be a counter in 6.x that tracks the incoming row count for an operator when the info is available - I haven’t gone looking for it though.

—Sharon
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Get status of a long running insert ...

Post by JimKnicely » Wed Apr 23, 2014 1:05 pm

The query seems to work better than an earlier post. At least, it'll give you a ball park of when the insert will complete...

Code: Select all

SELECT counter_name,
       MAX(counter_value),
       MIN(counter_value),
       ROUND(AVG(counter_value)) AVG
  FROM execution_engine_profiles
 WHERE (counter_name ILIKE '%sort%'
    OR counter_name ILIKE '%clock%'
    OR counter_name ILIKE '%estimated%')
   AND session_id = '???'
 GROUP BY counter_name
 ORDER BY counter_name;
In this query, I believe that as the AVG "rows output by sort" approaches the MAX "estimated rows produced" the INSERT will be closer to completion.

​Example:

Code: Select all

   
vertica=> SELECT counter_name, MAX(counter_value),
vertica->        MIN(counter_value),
vertica->        ROUND(AVG(counter_value)) AVG
vertica->   FROM execution_engine_profiles
vertica->  WHERE (counter_name ILIKE '%sort%'
vertica->     OR counter_name ILIKE '%clock%'
vertica->     OR counter_name ILIKE '%estimated%'
vertica->    AND session_id = 'prd-db-01.u-28326:0x2efc')
vertica->  GROUP BY counter_name
vertica->  ORDER BY counter_name;
      counter_name       |    MAX     |    MIN    |    AVG   
-------------------------+------------+-----------+-----------
 clock time (us)         | 7970590481 |         0 |   8312379
 estimated rows produced |  905522180 | 905522180 | 905522180
 rows output by sort     |  696839831 |         0 |  12274690
(3 rows)
AS Scutter pointed out, the "estimated rows produced" is an estimate, but I've found it to be a pretty good estimate :)
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “New to Vertica Database Administration”