Impala command to know DB table size - hadoop

Is there any way that we can check the DB table size and other properties ? I tried COMPUTE STATS but it gives the details of table except the size.
any link to find information and other details are much appreciated.

show table stats tablename
Works as I wanted, Thanks alot

Related

any ideas for count job on hive?

we are having issues some issues in our data stored in hive. we have more than 50 tables that has PB of data. In order to fix the issue, we are taking hive count and then analyzing the issues. so, i have to spend around 2-3 hours approximately everyday for count job since our tables are huge.
I am just wondering if there is any tools/application or ideas to reduce the amount of time to spend for count job.
I could not find anything in google about this.
You have two options -
if you want correct and actual count, you can use pyspark or spark. Use count like select count(1) from mytable and do not use count(*).
But this can give you perf problem if you have table of PB size.
if you want somewhat close count, you can use show table stats mytab, this shows rowcount (#Rows). If your hive system is set to gather table stats daily/regularly, you will get a count which is close to the actual count. If your table is partitioned, you need to add all partitions up.

dbeaver table editing is blocked, what should I do?

image
You cannot edit the data in the table.
Field names are marked as locked.
How do I solve this?
DB : ORACLE
try to refresh the database connection. It worked for me, I couldn't insert rows after creating the table.
Never used dbeaver myself... after a little googling found this forum
post: https://dbeaver.io/forum/viewtopic.php?f=2&t=621
Though, this is an old post it mentions that:
DBeaver can edit table only if it has at least one unique key or index
and also
regarding oracle pseudo columns like rowid
for now DBeaver doesn't support "hidden" pseudocolumn at all
So, could you check if you can edit tables with unique key?

Oracle determine tablespace name from id

Oracle 11.2.0.3.0
I am trying to create a graph with historical database size information. The table dba_hist_tbspc_space_usage is clearly the one to use however as shown in this link this table has a TABLESPACE_ID.
Can someone tell me how to find a mapping between tablespace_id and tablespace_name? I tried querying in all_tablespaces but there is no id. However I can see that it is somehow the #rownum (?)
Is there a correct way to find the mapping?
Tablespace Id is present in v$tablespace view (TS# column).
You can refer more about it from oracle documentation
Cheers!!

How can i get the queries executed on a particular table in database

I wanted to find the queries that were executed on a particular table in database
Let me know the query...through which I can fetch the queries that were executed on a particular table
You can use the AUDIT feature of Oracle DB as concrete and customized solution.
Please see my answer in the following question: SQL - Find statement that insert specific values
For more details regarding auditing, Please follow the Oracle documentation: https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_4007.htm
Feel free to ask in comments, if you have any doubts.
Cheers!!

which hive table gives better performance?

i'm beginner to hadoop.
internal table: the table is stored in hive warehouse and if it is dropped, both the metadata and data is deleted.
external table: the table is stored in hdfs and if it is dropped, only the metadata is deleted.
now, which table gives better performance while querying?please give reason.
also, it is highly appreciable if you could give some more difference for this tables in real time.
thanks in advance.
There is no performance difference at all between internal table and external table. The only difference is just like what you mentioned - one thing to note is hive warehouse is also in HDFS (with different path)

Resources