Skip to content

sys.log_load

This system view logs information about completed bulk load (ybload) operations. The sys.load view contains the same information for ybload operations that are in progress.

Column NameData TypeDescription
session_keytextUnique authentication key for the ybload 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. (A unique query ID is not assigned until the bulk load transaction is executed.)
statetextState of the load operation, such as STARTING, DONE, or ERROR.
error_stringtextError message for a failed load.
table_idbigintThe unique ID for the table. Tables in different schemas within the same database may have the same name, so you can use this ID to uniquely identify a table.
schema_idbigintUnique ID of the schema that contains the table being loaded.
database_idbigintUnique ID of the database that contains the table being loaded.
user_idbigintUnique ID of the user who ran the ybload command.
session_idbigintSession ID; foreign key to the sys.session and sys.log_session views.
table_nametextName of the table being loaded.
schema_nametextName of the schema that the table belongs to.
database_nametextName of the database that the table belongs to.
usernametextName of the user who ran the ybload command.
client_hostnametextHost name of the client system where the load was started.
client_usernametextClient OS user running the ybload command.
start_timetimestamptzWhen the ybload command started running.
end_timetimestamptzWhen the ybload command completed its execution.
elapsed_msdecimal(18,3)Duration of the load, in milliseconds.
remaining_msdecimal(18,3)Estimated number of milliseconds remaining to complete the load. (This value is always 0.0 for completed loads in this view.)
transaction_firstbigintFirst transaction ID for the load. Bulk load operations may be split into multiple transactions.
transaction_lastbigintLast transaction ID for the load. Bulk load operations may be split into multiple transactions.
num_transactionsbigintTotal number of transactions for the load operation.
parsed_rowsbigintNumber of rows that have been parsed.
parsed_bytesbigintAmount of table data read from the source file (in uncompressed bytes).
parsed_rows_per_seconddouble precisionNumber of rows parsed per second.
parsed_bytes_per_seconddouble precisionAmount of table data read from the source file per second (in uncompressed bytes).
inserted_rowsbigintThe number of rows that were loaded successfully into the table.
inserted_bytesbigintAmount of table data written to the table (in compressed bytes). inserted_bytes may be greater than parsed_bytes, given the overhead of the size of a shard (unit of data storage).
inserted_rows_per_seconddouble precisionNumber of rows that were loaded successfully per second.
inserted_bytes_per_seconddouble precisionAmount of table data written to the table per second, in bytes.
error_rowsbigintThe number of rows that could not be loaded into the table (see the .bad rows file for details).
sent_bytesbigintNumber of bytes transferred over the network during the load.
sent_bytes_per_seconddouble precisionNumber of bytes transferred per second during the load.
tagstextQuery tags in the system, as defined with a SET YBD_QUERY_TAGS command. Tags may be logged based on WLM rule processing. NULL if the query received no tags.

Examples

The following example shows information for a load of 26 million rows into the newmatchstats table. (Expanded ybsql display is used in this example for readability.)

premdb=# select * from sys.log_load where table_name = 'newmatchstats';
-[ RECORD 1 ]-------------+-----------------------------------------------------------------
session_key               | A0iOTdPuAXDBlGY_IJcXrFZXoxncCDlG1Spo5477TVa9P-Y9IE8k30FarQ9iCx1e
state                     | DONE
error_string              | [NULL]
table_id                  | 16496
schema_id                 | 2200
database_id               | 16404
user_id                   | 16415
session_id                | 18913
table_name                | newmatchstats
schema_name               | public
database_name             | premdb
username                  | bobr
client_hostname           | ybload100
client_username           | ybuser100
start_time                | 2018-03-26 16:42:09.233-07
end_time                  | 2018-03-26 16:42:16.012-07
elapsed_ms                | 6779.000
remaining_ms              | 0.000
transaction_first         | 179110
transaction_last          | 179110
num_transactions          | 1
parsed_rows               | 25990128
parsed_bytes              | 659797724
parsed_rows_per_second    | 3820717.46658389
parsed_bytes_per_second   | 96994546.8717621
inserted_rows             | 25990128
inserted_bytes            | 727723568
inserted_rows_per_second  | 3833917.66216401
inserted_bytes_per_second | 107349692.180362
error_rows                | 0
sent_bytes                | 727723568
sent_bytes_per_second     | 106980086.712245

premdb=# select count(*) from newmatchstats;
  count   
----------
 25990128
(1 row)

The following example returns the duration, in seconds, of the same load into the same table:

premdb=# select table_id, start_time, end_time, trunc(elapsed_ms/1000,2) as duration, inserted_rows, error_rows, inserted_bytes 
from sys.log_load where table_name='newmatchstats' and session_id=18913;
 table_id |         start_time         |          end_time          | duration | inserted_rows | error_rows | inserted_bytes 
----------+----------------------------+----------------------------+----------+---------------+------------+----------------
   16496 | 2018-03-26 16:42:09.233-07 | 2018-03-26 16:42:16.012-07 |     6.77 |      25990128 |          0 |      727723568
(1 row)

Parent topic:System Views