Skip to content

sys.log_unload

This system view captures information about completed unload (ybunload) operations.

Column NameData TypeDescription
session_keytextUnique authentication key for the ybunload operation. This is different from the session ID, which is the ID tracked for the user session in the sys.session and sys.log_session views.
statetextState of the unload operation, such as STARTING, DONE, or ERROR.
error_stringtextError message for a failed unload.
database_idbigintUnique ID of the database that contains the data being unloaded.
user_idbigintUnique ID of the user who ran the ybunload command.
session_idbigintSession ID; foreign key to the sys.session and sys.log_session views.
database_nametextName of the database that the data belongs to.
user_nametextName of the user who ran the ybunload command.
client_hostnametextHost name of the client system where the unload was started.
client_usernametextClient OS user running the ybunload command.
start_timetimestamptzWhen the ybunload command started running.
end_timetimestamptzWhen the ybunload command completed its execution.
elapsed_msbigintDuration of the unload, in milliseconds.
sql_querytextThe SELECT statement that was run to unload data.
sent_rowsbigintNumber of rows transferred over the network during the unload.
sent_bytesbigintNumber of bytes transferred over the network during the unload.
sent_rows_per_seconddouble precisionNumber of rows transferred per second during the unload.
sent_bytes_per_seconddouble precisionNumber of bytes transferred per second during the unload.

Example

The following example tracks the progress of an unload every 2 seconds:

premdb=# select * from sys.unload where start_time>'2018-05-02 18:00:00-07';
(0 rows)

premdb=# \watch
(0 rows)

Watch every 2s	Wed May  2 18:00:13 2018

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | CDil7ZNCMkZDvlgSPiHZn7qR4Wv7KLkXM3DLpIIMYXd6arJT0L0OFBDKPBNSaojf
state                 | RUNNING
error_string          | [NULL]
database_id           | 16423
user_id               | 16434
session_id            | 16792
database_name         | premdb
user_name             | bobr
client_hostname       | localhost
client_username       | yb100
start_time            | 2018-05-02 18:00:11-07
last_activity_time    | 2018-05-02 18:00:11-07
elapsed_ms            | 1860
sql_query             | select * from "newmatchstats"
sent_rows             | 0
sent_bytes            | 0
sent_rows_per_second  | 0
sent_bytes_per_second | 0

Watch every 2s	Wed May  2 18:00:15 2018
...

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | CDil7ZNCMkZDvlgSPiHZn7qR4Wv7KLkXM3DLpIIMYXd6arJT0L0OFBDKPBNSaojf
state                 | COMPLETE
error_string          | [NULL]
database_id           | 16423
user_id               | 16434
session_id            | 16792
database_name         | premdb
user_name             | bobr
client_hostname       | localhost
client_username       | yb100
start_time            | 2018-05-02 18:00:11-07
last_activity_time    | 2018-05-02 18:00:21-07
elapsed_ms            | 9851
sql_query             | select * from "newmatchstats"
sent_rows             | 25990128
sent_bytes            | 659797740
sent_rows_per_second  | 2599012.8
sent_bytes_per_second | 65979774

...
Watch every 2s	Wed May  2 18:00:23 2018
...

-[ RECORD 1 ]---------+-----------------------------------------------------------------
session_key           | CDil7ZNCMkZDvlgSPiHZn7qR4Wv7KLkXM3DLpIIMYXd6arJT0L0OFBDKPBNSaojf
state                 | DONE
error_string          | [NULL]
database_id           | 16423
user_id               | 16434
session_id            | 16792
database_name         | premdb
user_name             | bobr
client_hostname       | localhost
client_username       | yb100
start_time            | 2018-05-02 18:00:11-07
last_activity_time    | 2018-05-02 18:00:21-07
elapsed_ms            | 10353
sql_query             | select * from "newmatchstats"
sent_rows             | 25990128
sent_bytes            | 659797740
sent_rows_per_second  | 2599012.8
sent_bytes_per_second | 65979774

...

Parent topic:System Views