CURRENT_STATEMENT column in SESSIONS table too small ...

Moderator: NorbertKrupa

Post Reply
harryrundles
Intermediate
Intermediate
Posts: 96
Joined: Thu Jul 19, 2012 12:33 am

CURRENT_STATEMENT column in SESSIONS table too small ...

Post by harryrundles » Wed Sep 19, 2012 5:59 pm

Hi all,

Anyone know the why the statement_id in the sessions system table is sized so small? A lot of times the queries that are being running get cut off because the column is too small to see the full text.

I think its a varchar(8192) as is shown in my test below:

Code: Select all

dbadmin=> create table my_sessions as select * from sessions;
CREATE TABLE
dbadmin=> \dt my_sessions;
                     List of tables
    Schema    |    Name     | Kind  |  Owner  | Comment
--------------+-------------+-------+---------+---------
 intersect_wh | my_sessions | table | dbadmin |
(1 row)

dbadmin=> \d my_sessions;
                                                    List of Fields by Tables
    Schema    |    Table    |           Column           |     Type      | Size | Default | Not Null | Primary Key | Foreign Key
--------------+-------------+----------------------------+---------------+------+---------+----------+-------------+-------------
 verticadb_wh | my_sessions | node_name                  | varchar(128)  |  128 |         | f        | f           |
 verticadb_wh | my_sessions | user_name                  | varchar(128)  |  128 |         | f        | f           |
 verticadb_wh | my_sessions | client_hostname            | varchar(128)  |  128 |         | f        | f           |
 verticadb_wh | my_sessions | client_pid                 | int           |    8 |         | f        | f           |
 verticadb_wh | my_sessions | login_timestamp            | timestamptz   |    8 |         | f        | f           |
 verticadb_wh | my_sessions | session_id                 | varchar(80)   |   80 |         | f        | f           |
 verticadb_wh | my_sessions | client_label               | varchar(256)  |  256 |         | f        | f           |
 verticadb_wh | my_sessions | transaction_start          | timestamptz   |    8 |         | f        | f           |
 verticadb_wh | my_sessions | transaction_id             | int           |    8 |         | f        | f           |
 verticadb_wh | my_sessions | transaction_description    | varchar(8192) | 8192 |         | f        | f           |
 verticadb_wh | my_sessions | statement_start            | timestamptz   |    8 |         | f        | f           |
 verticadb_wh | my_sessions | statement_id               | int           |    8 |         | f        | f           |
 verticadb_wh | my_sessions | last_statement_duration_us | int           |    8 |         | f        | f           |
 verticadb_wh | my_sessions | runtime_priority           | varchar(8192) | 8192 |         | f        | f           |
 verticadb_wh | my_sessions | current_statement          | varchar(8192) | 8192 |         | f        | f           |
 verticadb_wh | my_sessions | last_statement             | varchar(8192) | 8192 |         | f        | f           |
 verticadb_wh | my_sessions | ssl_state                  | varchar(80)   |   80 |         | f        | f           |
 verticadb_wh | my_sessions | authentication_method      | varchar(80)   |   80 |         | f        | f           |
(18 rows)
Is there a way to describe SYSTEM tables?

Thanks!
Thanks,
Harry

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

Re: CURRENT_STATEMENT column in SESSIONS table too small ...

Post by scutter » Thu Sep 20, 2012 3:46 am

The 'request' column of the Data Collector table dc_requests_issued is 64000 characters.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

harryrundles
Intermediate
Intermediate
Posts: 96
Joined: Thu Jul 19, 2012 12:33 am

Re: CURRENT_STATEMENT column in SESSIONS table too small ...

Post by harryrundles » Thu Sep 20, 2012 12:04 pm

Thanks, Sharon!

When do queries move into the dc_requests_issued table? If I query it, it does not have any of the current queries running. In fact, the first queries I see in this table are from yesterday!

I am running this:

Code: Select all

select user_name, time, node_name, session_id
  from dc_requests_issued
 where time > trunc(sysdate, 'dy')
 order by user_name, time desc;
UPDATE: Please ignore this dumb question :oops: I realized I that I am ordering by the user_name first and the last time that user ran a query WAS yesterday! Duh!
Thanks,
Harry

Post Reply

Return to “New to Vertica Database Administration”