You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2020/03/05 16:50:04 UTC

svn commit: r1874847 - in /jackrabbit/oak/branches/1.22: ./ oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java

Author: reschke
Date: Thu Mar  5 16:50:04 2020
New Revision: 1874847

URL: http://svn.apache.org/viewvc?rev=1874847&view=rev
Log:
OAK-8925: RDBDocumentStore: for SQL Server stats, include type_desc and fill_factor (merged r1874543 into 1.22)

Modified:
    jackrabbit/oak/branches/1.22/   (props changed)
    jackrabbit/oak/branches/1.22/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java

Propchange: jackrabbit/oak/branches/1.22/
------------------------------------------------------------------------------
  Merged /jackrabbit/oak/trunk:r1874543

Modified: jackrabbit/oak/branches/1.22/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.22/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java?rev=1874847&r1=1874846&r2=1874847&view=diff
==============================================================================
--- jackrabbit/oak/branches/1.22/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java (original)
+++ jackrabbit/oak/branches/1.22/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Thu Mar  5 16:50:04 2020
@@ -607,15 +607,16 @@ public enum RDBDocumentStoreDB {
             try {
                 con = ch.getROConnection();
                 try (PreparedStatement stmt = con.prepareStatement(
-                        "SELECT i.[name] AS name, SUM(s.[row_count]) as rows, SUM(s.[used_page_count] * 8) as usedKB, SUM(s.[reserved_page_count] * 8) as reservedKB "
+                        "SELECT i.[name] AS name, i.[fill_factor] as fill_factor, i.[type_desc] as type_desc, SUM(s.[row_count]) as rows, SUM(s.[used_page_count] * 8) as usedKB, SUM(s.[reserved_page_count] * 8) as reservedKB "
                                 + "FROM sys.dm_db_partition_stats AS s "
                                 + "INNER JOIN sys.indexes AS i ON s.[object_id] = i.[object_id] "
-                                + "    AND s.[index_id] = i.[index_id] WHERE i.[object_id]=OBJECT_ID(?) " + "GROUP BY i.[name]")) {
+                                + "AND s.[index_id] = i.[index_id] WHERE i.[object_id]=OBJECT_ID(?) "
+                                + "GROUP BY i.[name], i.[fill_factor], i.[type_desc]")) {
                     stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH));
                     try (ResultSet rs = stmt.executeQuery()) {
                         while (rs.next()) {
                             String index = rs.getString("name");
-                            String data = extractFields(rs, "rows usedKB reservedKB");
+                            String data = extractFields(rs, "rows usedKB reservedKB type_desc fill_factor");
                             result.put("index." + index + "._data", data);
                         }
                     }