dbeaver/dbeaver · warning · DBCException

Error reading table statistics

Error message

Error reading table statistics

What it means

Thrown while loading per-table size/statistics for an Altibase schema. AltibaseSchema queries a system catalog for table sizes, maps each row to a cached AltibaseTable, and delegates to fetchTableSize; any SQLException from the catalog query (missing view, privilege error, disconnect) is wrapped in this DBCException. The finally block still runs, resetting sizes for any table that never received statistics, so partial data never silently lingers.

Source

Thrown at plugins/org.jkiss.dbeaver.ext.altibase/src/org/jkiss/dbeaver/ext/altibase/model/AltibaseSchema.java:244

            return;
        }
        try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Load table status")) {
            try (JDBCPreparedStatement dbStat = session.prepareStatement(
                    "SELECT table_name, memory_size, disk_size FROM system_.sys_table_size_ WHERE USER_NAME = ?")) {
                dbStat.setString(1, getName());
                
                try (JDBCResultSet dbResult = dbStat.executeQuery()) {
                    while (dbResult.next()) {
                        String tableName = dbResult.getString(1);
                        AltibaseTable table = (AltibaseTable) getTable(monitor, tableName);
                        if (table != null) {
                            table.fetchTableSize(dbResult);
                        }
                    }
                }
            }
        } catch (SQLException e) {
            throw new DBCException("Error reading table statistics", e);
        } finally {
            for (GenericTableBase table : getTableCache().getCachedObjects()) {
                if (table instanceof AltibaseTable && !((AltibaseTable) table).hasStatistics()) {
                    ((AltibaseTable) table).resetSize();
                }
            }
            hasStatistics = true;
        }
    }
    
    static class DbLinkCache extends JDBCObjectLookupCache<GenericObjectContainer, AltibaseDbLink> {

        @Nullable
        @Override
        protected AltibaseDbLink fetchObject(@NotNull JDBCSession session, @NotNull GenericObjectContainer container, 
                @NotNull JDBCResultSet resultSet) throws SQLException, DBException {
            return ((AltibaseMetaModel) container.getDataSource().getMetaModel()).createDbLinkImpl(container, resultSet);
        }

View on GitHub (pinned to 1e5ee1042b)

Solutions

  1. Verify the connected Altibase user has SELECT privilege on the system_ catalog views used by the statistics query.
  2. Check the Altibase server version matches the catalog view names the plugin expects; upgrade the DBeaver Altibase plugin or the server to a compatible version.
  3. Inspect the wrapped SQLException (cause) for the SQLState / vendor error code to identify a missing-view vs. permission vs. connectivity failure.
  4. If statistics are optional for your workflow, allow the load to fail gracefully — the finally block already resets sizes so the schema tree still renders.

Example fix

// before
} catch (SQLException e) {
    throw new DBCException("Error reading table statistics", e);
}
// after - surface the SQLState so the user can distinguish permission vs. missing view
} catch (SQLException e) {
    log.warn("Error reading table statistics for schema " + getName(), e);
    throw new DBCException("Error reading table statistics [" + e.getSQLState() + "]: " + e.getMessage(), e);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify the user can see the statistics catalog before triggering a full schema refresh
try (JDBCSession s = DBUtils.openMetaSession(monitor, schema.getDataSource(), "preflight");
     JDBCPreparedStatement ps = s.prepareStatement(
         "SELECT 1 FROM system_.sys_table_size_ WHERE ROWNUM <= 1")) {
    ps.executeQuery();
} catch (SQLException ignored) {
    // statistics unavailable - skip the refresh
}

Try / catch

try {
    schema.readStatistics(monitor);
} catch (DBCException e) {
    log.warn("Altibase statistics unavailable for " + schema.getName(), e);
    // schema tree remains usable; sizes simply stay unset
}

Prevention

When it happens

Trigger: Called from the schema statistics refresh path: getTable(monitor, tableName) lookup + fetchTableSize(dbResult) inside a while(dbResult.next()) loop over a JDBCResultSet backed by an Altibase system_. view. Fires when executeQuery() or dbResult.getString(1) raises SQLException, or when the underlying Altibase server rejects the catalog query.

Common situations: Connecting to an Altibase version whose sys_table_size_ / statistics catalog view is renamed or absent; a low-privilege database user lacking SELECT on the statistics dictionary view; transient network drop or session timeout during a large-schema statistics load; system_. schema not present in older Altibase builds.

Related errors


AI-assisted analysis of dbeaver/dbeaver@1e5ee1042b (2026-08-13). Data as JSON: /api/errors/072dec7d63dd8a0b. Report an issue: GitHub.