Closing user sessions in Vertica

Hi,

 

I'm trying to set up a cronjob for closing user sessions in vertica. I'm using following query to close the sessions.

 

SELECT * FROM sessions s
WHERE s.login_timestamp <= timestampadd(hour, -3, sysdate)
AND s.current_statement = ''

 

I run close_session for the session ids fetched from above.

 

I want to ensure that I dont delete any internal session. I see that in vertica documentation, client_hostname or user_name will be NULL for internal sessions but I do see some system related queries which have NON NULL values for client_hostname or user_name in SESSIONS table. I'm little confused over here. Could someone please explain why these internal sessions (mostly SELECT queries) have non-NULL values in these columns?

Comments

  • The Session table has only user sessions. The vs_sessions have also the internal sessions, so if you use the session table you should be just fine.

     

Leave a Comment

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