Discussions

Expand all | Collapse all

How to get Table Details based on file available in OmniSci Data Directory

Jump to Best Answer
  • 1.  How to get Table Details based on file available in OmniSci Data Directory

    Posted 5 days ago
    Checking OS Data Directory and observed that Few directory size are large. Please let us know how we can check this is corresponding to which Schema and which Table.

    [mapd_data]$ du -h --max-depth=1
    8.1M ./DB_2_DICT_66
    334G ./table_2_32
    402M ./table_2_37

    Regards,
    sumit
    #Core


  • 2.  RE: How to get Table Details based on file available in OmniSci Data Directory
    Best Answer

    Posted 4 days ago
    Hi @Sumit Srivastava,

    I wrote a bash shell to get the table size (raw data + dictionaries) and did a post about it here

    ​I know it doeesn't reply exactly to you question, anyway to get which table correspond to table_2_37 iot's quite simple

    the first number represent the database number, the second the table number of that database so you have to connect to the central repository first to get the name of database with id2, then connect to the database name you got with first query

    cd $OMNISCI_StorAGE/mapd_catalogs
    sqlite3 omnisci_system_catalog
    sqlite> select dbid,name from mapd_databases where dbid=2;
    2|your_db
    sqlite> .quit
    
    sqlite3 your_db
    sqlite> select name from mapd_tables where tableid=37;
    your_table_37
    

    to get which dictionaries (I mean text encoded dictionary columns) are taking space, it's more tricky because the dictionaries are shared between the tables within the database, so you have to join the mapd_tables with mapd_dictionaries to get the dictionary id



  • 3.  RE: How to get Table Details based on file available in OmniSci Data Directory

    Posted 4 days ago
    Hi @Candido Dessanti,

    Thanks for sqlite queries and it helped lot.

    /sumit