dasklkdlasjl
asbabkd
asbabkd
SELECT
t.NAME AS TableName,
s.Name AS SchemaName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 AS TotalSpaceKB,
SUM(a.used_pages) * 8 AS UsedSpaceKB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB
FROM
sys.tables t
INNER JOIN
sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
sys.allocation_units a ON p.partition_id = a.container_id
LEFT OUTER JOIN
sys.schemas s ON t.schema_id = s.schema_id
WHERE
t.NAME ='RETENTION_METRICS_Vertica'
AND t.is_ms_shipped = 0
AND i.OBJECT_ID > 255
GROUP BY
t.Name, s.Name, p.Rows
ORDER BY
t.Name
SELECT t.table_name AS table_name,
SUM(ps.wos_row_count + ps.ros_row_count) AS row_count,
SUM(ps.wos_used_bytes + ps.ros_used_bytes) AS byte_count,sum(ps.USED_BYTES) as sum_used_bytes
FROM tables t
JOIN projections p ON t.table_id = p.anchor_table_id
JOIN projection_storage ps on p.projection_name = ps.projection_name
WHERE t.table_name ='subscription'
GROUP BY t.table_name
ORDER BY byte_count DESC;
drop table if exists test.hdfsdata;
create table test.hdfsdata(
col1 int,
col2 varchar(100)
);
hadoop fs -put hdfsdata.txt /user/tickmoh/test/.
vsql> COPY test.hdfsdata SOURCE Hdfs(url='localhost:50070/webhdfs/v1/user/tickmoh/test/hdfsdata.txt', username='tickmoh') DELIMITER AS ' ' NULL AS 'null';
drop table if exists test.hdfsdata_ext;
create external table test.hdfsdata_ext(
col1 int,
col2 varchar(100)
)
AS COPY SOURCE Hdfs(url='localhost:50070/webhdfs/v1/user/tickmoh/test/hdfsdata.txt', username='tickmoh') DELIMITER AS ' ' NULL AS 'null';
SELECT query_profiles.transaction_id, query_profiles.statement_id, query_profiles.query, resource_acquisitions.open_file_handle_count, resource_acquisitions.thread_count, resource_acquisitions.memory_inuse_kb, resource_acquisitions.duration_ms FROM query_profiles, resource_acquisitions WHERE ( resource_acquisitions.transaction_id = query_profiles.transaction_id AND resource_acquisitions.statement_id = query_profiles.statement_id ) AND ( query_profiles.transaction_id = 49539595901078494 AND query_profiles.statement_id = 1 );
SELECT transaction_id, statement_id, io_type, projection_name FROM projection_usage ORDER BY query_start_timestamp DESC;
dbadmin=> select EXPORT_TABLES ( '' , 'public.sales' );
dbadmin=> select EXPORT_TABLES ( '/home/dbadmin/scripts/sales.txt' , 'public.sales' );
default is '' means standard output , it will print on screen.