You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
number of data/size of data calculated by footprint in memory, number of columns and its types
This functionality could be auto-enabled for all tables or only for huge tables with many rows, also will be great to ask about the stat in alternative ways rather than proposed below:
// Your original query
val originalQuery = "SELECT * FROM your_table_name WHERE column_name = 'some_value'"
// Query to count the number of rows
val countQuery = "SELECT COUNT(*) as count FROM (" + originalQuery + ") AS count_query"
// Create a statement and execute the count query
val countStatement = connection.createStatement()
val countResultSet = countStatement.executeQuery(countQuery)
// Get the row count
val rowCount = 0
if (countResultSet.next()) {
rowCount = countResultSet.getInt("count")