所有表:
    select TABLE_NAME, concat(truncate(data_length/1024/1024,2),’ MB’) as data_size, concat(truncate(index_length/1024/1024,2),’ MB’) as index_size from information_schema.tables where TABLE_SCHEMA = ‘test’ group by TABLE_NAME order by data_length desc;

    单表:
    select TABLE_NAME, concat(truncate(data_length/1024/1024,2),’ MB’) as data_size, concat(truncate(index_length/1024/1024,2),’ MB’) as index_size from information_schema.tables where TABLE_SCHEMA = ‘Test’ group by TABLE_NAME order by data_length desc;

    1. private int GetRTDataByTagNameAsyn(String tagName, TagData tagData) {
    2. if (tagName.length() >= TAGNAME_LENGTH) {
    3. logger.error("查询实时数据的点名长度过长:" + tagName);
    4. return STATUS_PARAM_INVALID;
    5. }
    6. RTDBInterfaceLibrary clib = RTDBInterfaceLibrary.SYNC_INSTANCE;
    7. Pointer cTagName = new Memory(tagName.getBytes().length + 1);
    8. cTagName.setString(0, tagName);
    9. RTDBImpl.RTDBInterfaceLibrary.TagData cTagData = new RTDBImpl.RTDBInterfaceLibrary.TagData();
    10. int result = STATUS_INVOKE_FAILED;
    11. try {
    12. Date s = new Date();
    13. result = clib.GetRTDataByTagName(cTagName, cTagData);
    14. Date e = new Date();
    15. if(logger.isInfoEnabled()){
    16. logger.info("查询测点的实时数据耗时:" + (e.getTime() - s.getTime()) + "ms.[" + tagName + "]");
    17. }
    18. if (result != RTDBImpl.STATUS_OK) {
    19. logger.warn("查询测点的实时数据失败! Return:[" + RTDBDaoHelper.getStringStatus(result) + "],[tagName=" + tagName + "]");
    20. } else if (logger.isInfoEnabled()) {
    21. logger.info("查询测点的实时数据成功![" + tagName + "]");
    22. }
    23. if (result == RTDBImpl.STATUS_OK) {
    24. tagData.setValue(cTagData.value);
    25. // must use long variable
    26. NativeLong nl = cTagData.time;
    27. long time = (nl).longValue();
    28. tagData.setTime(new Date(time * 1000));
    29. int status = cTagData.status;
    30. tagData.setStatus(status);
    31. if (logger.isDebugEnabled()) {
    32. logger.debug("查询测点的实时数据成功! [" + tagName + "]" + tagData);
    33. }
    34. }
    35. } catch (Exception e) {
    36. logger.error("查询测点的实时数据异常[" + tagName + "]:" + e.getLocalizedMessage());
    37. if (logger.isDebugEnabled()) {
    38. logger.debug("查询测点的实时数据异常[" + tagName + "]", e);
    39. }
    40. } finally {
    41. long cTagNamePeer = Pointer.nativeValue(cTagName);
    42. Native.free(cTagNamePeer);
    43. Pointer.nativeValue(cTagName, 0);
    44. }
    45. return result;
    46. }