concurrent sessions (check active or inactive)

How to check if a session is active or not ?


I'm new to vertica and I'm using this sql statement, but I'm not sure if I'm doing it right ?
any suggestion or sample query ?

select  count(*) from sessions where transaction_id > 0  => for active sessions 

select  count(*) from sessions where transaction_id <= 0  or current_statement ='  '
=> for active sessions 

regards,
Patrick

Comments

  • In query_profiles table there is a flag is_executing, which can be used for running transaction quries.

    select session_id,transaction_id,query from query_profiles where transaction_id in(select transaction_id from sessions)and is_executing='t'

    Regards'

    Abhishek
  • Hi!

    Table SESSIONS must be enough.


    CURRENT_STATEMENT

    The currently executing statement, if any. NULL indicates that no statement is currently being processed.


    LAST_STATEMENT

    NULL if the user has just logged in; otherwise the currently running statement or the most recently completed statement.


    PS: It's so hard to read documentation :(

  • Terrible formatting (exactly - terrible and not horrible).

    GetSatisfaction - die!

Leave a Comment

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