Closed 1fifoto closed 1 year ago
Sample screen shot. Only displays in non-production environment (env !== 'production').
Internally the HelpAbout menu item transmits an /api/v1/db_size
GET request to the ODOP server. The server receives the request and issues a SELECT query to the JAWS DB server for the size information (similar to what is done by the db_size.sh script). The DB server processes the SELECT, and returns the size and other things (see Note below) to the ODOP server. The ODOP server returns the size to the HelpAbout client.
This is the SELECT statement (edited from the db_size.sh script)
SELECT NOW() AS date_time, s.schema_name AS schema_name, sp.grantee AS user, CAST(ROUND(SUM(COALESCE(t.data_length + t.index_length, 0)) / 1024 / 1024, 3) AS CHAR) AS db_size_mb, sp.has_insert AS has_insert
FROM information_schema.schemata AS s
INNER JOIN information_schema.tables AS t
ON s.schema_name = t.table_schema
INNER JOIN (
SELECT spi.grantee,spi.table_schema,MAX(
CASE
WHEN spi.privilege_type = 'INSERT' THEN 1
ELSE 0
END
) has_insert
FROM information_schema.schema_privileges AS spi
GROUP BY spi.grantee, spi.table_schema
) AS sp
ON s.schema_name = sp.table_schema
GROUP BY s.schema_name, sp.grantee, sp.has_insert
Note: Although the SELECT statement returns the date_time, schema_name, user, the db_size_mb and the has_insert, the ODOP server only returns the size to the HelpAbout menu client.
Merged into master, closing
Display DB Size on Help About modal.
See #800.