IBM Genius Hub Β· Db2 AI Assistant
Using the Db2 AI Assistant
for Storage & Space Management
A practical guide for DBAs β what questions to ask the IBM Genius Hub AI Assistant about Db2 storage, what kind of answers to expect, and how to act on them.
IBM Db2 Β· Genius HubΒ·Space Management Β· REORGCHK Β· Reorganization Β· Range PartitioningΒ·12 min read
By Askari Naqvi, Krishna Guntuka & Naveen Balachandran
Your Database Is Getting Slower β and You Might Not Know It
Hereβs something that surprises many Db2 administrators: a database can degrade in performance over months, not because of bad queries or hardware problems, but simply because of the normal, everyday work it does β inserting rows, updating records, and deleting old data. Each operation leaves a small footprint: gaps in pages, oversized rows, degraded clustering, table spaces filling up silently. Over time, those footprints accumulate into something that measurably slows your workloads and inflates your storage costs.
The problem is silent. Query response times climb gradually. Storage costs creep up. Buffer pool efficiency quietly drops. By the time the slowdown is obvious, the fragmentation has been building for months.
IBM Genius Hubβs Db2 AI Assistant changes that. It connects directly to your Db2 instance, reads the diagnostic signals Db2 produces in real time, and answers your storage management questions in plain language β with the exact statistics, the root cause explanation, and the SQL commands to fix it. You donβt need to remember formula thresholds, look up syntax, or manually join ambiguous system catalog views. You just ask.
What Can the Db2 AI Assistant Do for Storage Management?
The AI Assistant covers the full spectrum of Db2 storage management β from understanding storage architecture to quick table space checks to deep fragmentation analysis and data lifecycle guidance. Hereβs an overview of what you can ask about:
π₯οΈ
Disk Architecture Analysis
- Information about storage architecture
- Database/Table space disk storage layout
π½
Table Space Analysis
- Table space utilization & capacity
- Space reclamation opportunities
- Why a table space is filling fast
- Space recoverable from specific objects
π
REORG Table/Index Analysis
- Identify table types, sizes etc.
- Evaluate REORGCHK formulas
- Identify REORG candidates
- Recommend when & how to REORG
- Guide extent reclamation for columnar tables
π
Range Partition Management
- Which partitions need reorganization
- Whether to detach a partition
- Partition-level remediation guidance
- Data lifecycle & archiving strategy
π
Storage Reporting
- Current table space usage
- Tables consuming the most space
- Overflow records & fragmentation
- Before and after estimates for offline table/index Reorg and in-place(online) table/index Reorg.
Each of these five categories is explored in depth later in this article, with one worked example conversation per category:
| Category |
Sample scenario covered |
| Disk Architecture Analysis |
To understand the underlying disk architecture, disk space usage, free space. Works for both Serial and MPP. |
| Table & Table Space Analysis |
Live investigation of Table and Table Spaces, Table Space Usage |
| REORG Analysis |
Analyzing tables for page overflows, fragmentation, index analysis |
| Range Partition Management |
Investigating range partition tables, attaching/detaching partitions |
| Storage Reporting |
Which tables in schema SALES currently need reorganisation, and in what order of priority? |
How the AI Assistant Works
The AI Assistant is not a generic chatbot. When you ask a question about a table or table space, it queries SYSCAT.TABLES, SYSCAT.INDEXES, SYSCAT.DATAPARTITIONS, MON_GET_TABLESPACE, and Db2βs other catalog tables and monitoring functions in real time, then analyses the results using expert driven knowledge, performs complex calculations and answers. The numbers in its responses are your actual numbers β not estimates or examples.
You are talking to your database, literally.
A Quick Primer: REORGCHK Formulas
Db2βs built-in table and index organization health-check utility (REORGCHK) evaluates eight diagnostic formulas (F1βF8) to measure different aspects of table and index health. When a formula breaches its threshold, Db2 AI Assistant flags it and recommends reorganisation. You donβt need to memorise these formulas β the AI Assistant knows all of them β but a quick overview helps you understand what the AI is telling you:
F1
Overflow records > 5% β rows grew too large for their original page (extra I/O per row read)
F2
Space utilisation < 70% β pages are sparsely populated after deletions (wasteful scans)
F3
Empty pages > 20% β entire pages contain no data (pure scan waste)
F4
Cluster ratio < 80% β rows not physically ordered for the clustering index (random I/O on range scans)
F5
Percentage of allocated space in use at the leaf level > 50% wasted β index pages have large gaps (bigger index, slower scans)
F6
Index leaf pages vs data pages ratio too high β index has grown disproportionately large relative to the table (excessive index I/O per lookup) - tree determination having fewer levels
F7
Pseudo-deleted entries > 20% β deleted row markers not yet cleaned up (ghost entries slow index scans)
F8
Pseudo-empty leaf pages > 20% β nearly-empty index pages from large-key deletions
The sections below walk through the four main categories of storage management questions you can ask the AI Assistant, with real example conversations for each.
Understanding the Db2 Storage Hierarchy
Before diving into specific questions, it helps to understand how Db2 organises storage on a Serial or multi-partition (MPP) system. Data does not live in a single flat pool β it is arranged in a hierarchy of four levels, and the AI Assistant can answer questions at every level.
| Members (Partitions)/ Storage Architecture |
Nodegroup (Partition Group) |
Table Space |
Table/Index |
| Physical machines or logical VMs. Each member has its own CPU, memory, and disk. A 4-member system means 4 independent data stores/ Physical Disk Information for each member |
A named subset of members. One nodegroup might span members 0β1; another members 2β3. Table spaces are always pinned to exactly one nodegroup. |
A named storage container backed by OS-level paths. Every table space belongs to one nodegroup and therefore lives on a specific set of members. |
A table/Index is placed into a table space. Its data is automatically hash-distributed across every member in that table spaceβs nodegroup. |
A Concrete Example (Using an MPP Cluster)
MPP Cluster Example
Imagine a four-member MPP cluster β member 0, 1, 2, 3 (one machine each). A DBA creates two nodegroups:
- NODEGRP1 β spans members 0 and 1 (dedicated to transactional workloads)
- NODEGRP2 β spans members 2 and 3 (dedicated to reporting workloads)
Inside NODEGRP1 the DBA creates table spaces TS_NG1_DATA1 and TS_NG1_DATA2. Inside NODEGRP2 they create ANALYTICS_DATA. A table placed in TS_NG1_DATA1 has its rows spread across members 0 and 1 only β members 2 and 3 never see that tableβs data.
This matters for space management: a table space that is 90% full on members 0β1 is not relieved by free space on members 2β3. The AI Assistant understands this topology and answers questions at the right level.
What the AI Assistant Can Tell You at Each Level
| Level |
Example question |
What the AI queries |
| Member (OS disk)/ Storage Architecture |
Whatβs the database path on member 1? How much free disk space is available on member 1? |
SYSPROC.ADMIN_GET_STORAGE_PATHS |
| Nodegroup |
What nodegroups exist and which members are in each? |
SYSCAT.NODEGROUPS, SYSCAT.DBPARTITIONGROUPDEF |
| Table Space |
Which table spaces are in NODEGRP1 and how full are they? |
SYSCAT.TABLESPACES, MON_GET_TABLESPACE |
| Table |
Which members hold data for SALES.ORDERS? |
SYSCAT.TABLES β SYSCAT.TABLESPACES β SYSCAT.NODEGROUPS β SYSIBMADM.ENV_INST_INFO |
OS-level (member) view
Answered via SYSPROC.ADMIN_GET_STORAGE_PATHS: reports the raw filesystem capacity and free space on each machine. This is your early-warning signal. If a filesystem is almost full, Db2 automatic storage cannot grow any further even if the table space has headroom.
Table Space view
Answered via MON_GET_TABLESPACE: reports how much of the table spaceβs allocated extent is actually used by Db2 data. A table space can appear 60% utilised while the underlying filesystem is 95% full β a dangerous gap that only the OS-level view reveals.
Member disk space vs. table space utilization β two different views
Example Conversations β Navigating the Hierarchy
IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

Start wide, then drill down
The most effective investigation follows the hierarchy: check member disk space first (OS view), then nodegroup topology (which members are affected), then table space utilization within the troubled nodegroup, and finally table-level fragmentation to find what can be reclaimed. The AI Assistant will follow this path automatically β or you can ask at any level and it will context-fill the rest.
π½
Category 1: Table & Table Space Analysis
Understand where your storage is going β and where you can get it back
Once you understand your storage topology, the next step is identifying exactly which tables and table spaces are consuming the most space β and how much of that is recoverable through reorganisation. Storage fills up gradually: bulk deletes leave half-empty pages, tables that havenβt been reorganised in months quietly hold twice the space they need, and table spaces creep towards capacity without warning. The AI Assistant can analyse this in seconds and tell you exactly whatβs recoverable.
Questions You Can Ask
- π¬ Run a space management health check on my database
- π¬ How much disk space can I reclaim by reorganizing SALES.LINEITEM?
- π¬ Which tables in schema SALES are consuming the most space?
- π¬ Analyze table space utilization and identify space reclamation opportunities
- π¬ Why is my USERSPACE1 table space filling up quickly?
Example Conversation
IBM Genius Hub β Db2 AI Assistant
You
How much disk space can I reclaim by reorganizing SIMULATOR.REORG_F2_TEST?
IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

IBM Genius Hub β Db2 AI Assistant

β Recommendation: offline REORG during a maintenance window for this table size.
What to expect from disk space questions
- Exact before/after storage numbers in MB, derived from your live SYSCAT statistics β not estimates
- I/O reduction in page counts β so you can quantify the performance benefit, not just the storage saving
- A clear online vs. offline recommendation based on your actual table size and workload
π
Category 2: REORG Analysis
Identify fragmentation, interpret REORGCHK formulas, and get the exact fix
REORGCHK produces a dense output of formula values, asterisks, and statistics. Interpreting it β figuring out which violations are urgent, what caused them, and what command to run β is exactly where the AI Assistant saves the most time. Ask it about any formula, any table, any index.
Questions You Can Ask
- π¬ Analyze the REORGCHK results for SALES.ORDERS and explain why F1 is violated
- π¬ What does a cluster ratio of 45% mean for index IDX_SHIP_DATE on SALES.SHIPMENTS?
- π¬ Check for overflow records and fragmentation in schema SALES
- π¬ Are there any tables in my database that currently need reorganization?
- π¬ What PCTFREE value should I use for this table to prevent future overflow issues?
- π¬ Guide me on reclaiming extents from ANALYTICS.EVENTS
Example Conversation β F1: Row Overflow
Tables with VARCHAR columns that are updated repeatedly β each update adding more text β can develop overflow records: the row grew beyond its original page slot, so Db2 stores the extra data elsewhere and places a pointer at the original location. Every read of that row now costs two I/O operations instead of one. This behaviour is intentional: by avoiding an immediate page reshuffle, Db2 keeps update performance fast and avoids taking a lock on surrounding rows. The trade-off is accepted silently; overflow is Db2βs way of prioritising write throughput over read efficiency. Once overflow grows beyond the F1 threshold (5%), a REORG pays back that debt by physically consolidating the rows and restoring single-I/O reads.
IBM Genius Hub β Db2 AI Assistant
You
Analyze the REORGCHK results for table SALES.ORDERS and explain why F1 is violated.
βΆ IBM Genius Hub AI Assistant
I ran REORGCHK on SALES.ORDERS and retrieved the current statistics from SYSCAT.TABLES. Hereβs what I found:
- CARD (row count): 100,000
- OVERFLOW: 15,203 rows (15.2% of total rows)
- F1 value: 15.2 β threshold is > 5% β
F1 is violated because 15,203 rows have overflow records. Each of those rows was updated in a way that made it too large to fit in its original page slot. Db2 stored the overflow portion on a separate page and left a pointer at the original location.
The practical impact: every query that reads one of these rows requires two page reads instead of one. Across a full table scan, this means up to 15,000 additional I/O operations. You will see measurable increases in query elapsed time and buffer pool read activity.
Root cause: The tableβs VARCHAR comment and notes columns were updated repeatedly, with each update progressively adding more text. With PCTFREE currently set to 0, there was no reserved space on the original pages for the rows to expand into.
β Reorganisation recommended. F1 = 15.2%, well above the 5% threshold.
You
What PCTFREE value should I use for this table to prevent future overflow issues?
βΆ IBM Genius Hub AI Assistant
Based on the update pattern I observed β rows growing approximately 35β45 bytes per update cycle, with up to 4 cycles β I recommend setting PCTFREE to 20 on this table.
PCTFREE reserves a percentage of each page for future row expansion. At 20%, each 8 KB page keeps roughly 1.6 KB free. Given your average final row size of ~82 bytes, this provides headroom for approximately 20 row expansions per page before overflow occurs.
Set the new value and fix existing overflow records in one step:
ALTER TABLE SALES.ORDERS PCTFREE 20; CALL SYSPROC.ADMIN_CMD('REORG TABLE SALES.ORDERS');
After the REORG, run RUNSTATS and re-check REORGCHK β F1 should return to 0%.
β After REORG with PCTFREE 20, F1 is expected to return to 0%.
Example Conversation β Columnar Extent Reclamation
Columnar (column-organised) tables store data by column in compressed blocks, making them ideal for analytics. But deletions create gaps in every columnβs storage simultaneously β breaking compression patterns and forcing more page reads. The AI Assistant can guide you through the analysis and the fix.
IBM Genius Hub β Db2 AI Assistant
You
Guide me on reclaiming extents from ANALYTICS.EVENTS
βΆ IBM Genius Hub AI Assistant
I retrieved the current statistics for ANALYTICS.EVENTS (ORGANIZE BY COLUMN):
- CARD: 24,891 rows (49.8% of the original 50,000)
- COL_OBJECT_L_SIZE: 8,192 KB (current compressed column storage)
- Estimated post-REORG size: ~4,200 KB (~48% reduction)
The deletions have left gaps in every column group simultaneously. Because columnar compression works best on dense, continuous data, the compression ratio has degraded from ~3:1 to approximately 1.6:1. Column scans now process the same number of pages for half the useful data.
To reclaim extents and restore compression, reorganise the table:
CALL SYSPROC.ADMIN_CMD('REORG TABLE ANALYTICS.EVENTS');
Important: Columnar table reorganisation is always offline β there is no INPLACE option. Db2 must decompress every column group, filter out deleted rows, re-encode, and recompress from scratch. This cannot be done while the table is accessible. For ~25,000 remaining rows, expect the operation to complete in under 60 seconds.
Expected results after REORG:
- COL_OBJECT_L_SIZE reduced from ~8 MB to ~4.2 MB (~48% storage saving)
- Compression ratio restored to ~3:1 or better
- Column scan I/O reduced by ~50%
- Analytical query elapsed time improvement: 30β50%, depending on column access pattern
β Plan a maintenance window. Columnar REORG always requires an offline operation.
What to expect from REORG analysis questions
- The AI evaluates the specific violated formula against your live statistics β not a generic description of what the formula does
- It explains the root cause in plain English (what operations caused it) and quantifies the performance impact
- It produces the exact REORG command, including any options specific to your scenario (INDEX for clustering, INPLACE for online, partition name for partition-level)
π
Category 3: Range Partition Table Management
Surgical maintenance and data lifecycle management for time-series tables
Range partitioned tables split data into named partitions by key range β typically date. This is powerful for time-series workloads: you can reorganise just one monthβs partition without touching the rest of the table, and archive old partitions in an instant with no data movement at all. The AI Assistant can analyse partition-level health and guide you through both operations.
Questions You Can Ask
- π¬ Are there any range partitioned tables in my database?
- π¬ Provide the partition details for SALES.ORDERS_HISTORY
- π¬ I want to know if any partitions in schema SALES require reorganization
- π¬ Is there any data in SALES.ORDERS_HISTORY prior to February 2023 that I can archive?
- π¬ What is the syntax to reorganize only the JAN_2023 partition?
- π¬ Explain the difference between DETACH PARTITION and DROP PARTITION
- π¬ Provide a data lifecycle management strategy for range partitioned tables
Example Conversation β Identifying Archivable Partitions
IBM Genius Hub β Db2 AI Assistant
You
Is there any data in the table SALES.ORDERS_HISTORY prior to February 2023 that I can archive?
βΆ IBM Genius Hub AI Assistant
I queried SYSCAT.DATAPARTITIONS for SALES.ORDERS_HISTORY. Here are the current partition boundaries and row counts:
| Partition |
Range |
Rows |
Pages |
| JAN_2023 |
'2023-01-01' to '2023-02-01' |
6,204 |
318 |
| FEB_2023 |
'2023-02-01' to '2023-03-01' |
5,891 |
β |
| MAR_2023 |
'2023-03-01' to '2023-04-01' |
6,107 |
β |
| APR_2023 |
'2023-04-01' to '2023-05-01' |
6,451 |
β |
Yes β the JAN_2023 partition contains all 6,204 rows with ORDER_DATE prior to 2023-02-01. It is the only partition that falls entirely within your requested date range, making it a clean archiving candidate.
To detach it into a standalone archive table (this is an instantaneous metadata operation β no rows are copied or moved):
ALTER TABLE SALES.ORDERS_HISTORY
DETACH PARTITION JAN_2023
INTO SALES.ORDERS_ARCHIVE_JAN;
After detachment, SALES.ORDERS_ARCHIVE_JAN becomes a regular table containing all 6,204 January rows. You can back it up, export it to cold storage, or drop it depending on your retention policy. The main table continues serving FEB, MAR, and APR partitions with zero interruption.
β JAN_2023 (6,204 rows) is ready to archive via DETACH PARTITION β a zero-downtime metadata operation.
What to expect from range partition questions
- Guidance on per-partition vs. whole-table REORG trade-offs, with a production-appropriate recommendation
π
Category 4: Storage Reporting
Get the current picture β table space capacity, top tables by size, fragmentation summary
Before tuning anything, you need situational awareness. The AI Assistant can pull current storage numbers from your live database and present them in a clear, actionable summary β so you always know where things stand.
Questions You Can Ask
- π¬ Show me current table space usage and capacity across all table spaces
- π¬ List the tables in schema SALES consuming the most space
- π¬ Are there any tables in schema SALES that currently need reorganization?
- π¬ Check for overflow records and fragmentation across all tables in schema SALES
- π¬ Show me the before and after statistics if I reorganize SALES.LINEITEM
Example Conversation β Full Fragmentation Scan
IBM Genius Hub β Db2 AI Assistant
You
Are there any tables in schema SALES that currently need reorganization?
βΆ IBM Genius Hub AI Assistant
I scanned SYSCAT.TABLES and SYSCAT.INDEXES for all user tables in schema SALES and evaluated the REORGCHK formulas. Here is a summary of tables with active violations, ordered by severity:
Critical β Immediate action recommended:
- SHIPMENTS β F4 (Cluster Ratio) = 45% β β range scan queries on IDX_SHIP_DATE are incurring severe random I/O overhead
- ORDERS β F1 (Overflow) = 15.2% β β 15,203 rows require two I/O operations per read
Warning β Reorganisation recommended soon:
- LINEITEM β F2 (Space utilisation) = 49.8% β β ~5 MB reclaimable, full-scan I/O doubled
- INVENTORY.PRODUCTS β F3 (Empty pages) = 26.1% β β 326 completely empty pages being scanned unnecessarily
- ANALYTICS.EVENTS β F2 = 49.8% β β columnar table with degraded compression (8 MB β ~4.2 MB after REORG)
- HR.AUDIT_LOG β F7 (Pseudo-deleted index entries) = 30.4% β β index IDX_AUDIT_ID contains 30,400 ghost entries
Healthy β No action needed:
- FINANCE.TRANSACTIONS β All formulas within thresholds
- FINANCE.ACCOUNTS β Within thresholds
Ask me about any of these tables for a detailed analysis and the exact remediation commands.
β 6 tables require reorganisation. Start with SALES.SHIPMENTS and SALES.ORDERS for the highest performance impact.
What to expect from storage reporting questions
- A prioritised list of objects needing attention β ordered by severity, not alphabetically β so you know where to start
- Summary-level numbers (violation type, current value, reclaimable space) you can use to build a maintenance plan
- An invitation to drill in: ask a follow-up about any specific table to get detailed analysis and remediation commands
5 Tips for Getting the Most Out of Your AI Assistant
01
Name your table explicitly
Include the full schema and table name β e.g., SALES.ORDERS. The AI queries live statistics for that exact object rather than giving a generic answer.
02
Ask for before/after estimates
Try βShow me the before and after statistics if I reorganise this table.β The AI calculates expected post-REORG page counts, storage sizes, and I/O improvements from your current numbers.
03
Ask follow-up questions
If the AI recommends offline REORG and you need online, just say: βWhat if I canβt take downtime?β It understands context and revises the recommendation accordingly.
04
Request the exact command
Donβt stop at a general recommendation β ask βGive me the exact REORG command for this table.β The AI produces copy-paste-ready SQL with the correct options and follow-up RUNSTATS.
05
Start broad, then drill in
Open with βAre there any tables in schema SALES that need reorganisation?β to get a prioritised scan of all objects, then ask follow-ups about specific tables from the list.
Not sure what to ask? Start here
These three questions give you immediate situational awareness of any Db2 database:
βAre there any tables in schema [X] that currently need reorganisation?β
βShow me current table space usage and capacity.β
βCheck for overflow records and fragmentation across all tables in schema [X].β
Next Steps
The conversations shown in this post are representative examples of the kinds of questions you can ask the IBM Genius Hub AI Assistant against your own Db2 databases. The AI Assistant connects directly to your instance and returns real statistics from your actual tables β the names, numbers, and commands will reflect your environment, not generic placeholders.
- β
- β
IBM Genius Hub β Db2 AI Assistant Connect your Db2 instance and start asking the AI Assistant about your real database β live REORGCHK analysis, query tuning, lock diagnostics, HADR monitoring, and more.
- β
Disclaimer
Some questions, conversations, and AI responses shown in this article are illustrative examples only and some are real. They are intended to demonstrate the types of questions you can ask and the style of answers the IBM Genius Hub AI Assistant provides. Specific table names, schema names, row counts, storage values, and hostnames are fictional and do not represent any real database or customer environment.
About the Authors
Askari Naqvi
Staff Software Engineer β IBM Toronto Lab
Askari Naqvi is a Staff Software Engineer in IBM Toronto Lab with 25+ experience with Db2 LUW engine development and testing experience across various Db2 products, currently working on Db2 Agentic AI development and specifically for Db2 AI Assistant. He can be reached at askarin@ca.ibm.com.
Krishna Guntuka
Lead Software Engineer β Db2 Agentic AI
Krishna Guntuka is a Lead Software Engineer with 9+ years of experience across various Db2 products, currently leading Agentic AI development for the Db2 Database Assistant β building intelligent autonomous agents using Python, LangChain, LangGraph, RAG pipelines, and LLMs β with a focus on making Db2 products smarter, faster, and more efficient.
Naveen Balachandran
Software Developer β Db2 Agentic AI
Naveen Balachandran is a Software Developer in the Db2 Agentic AI team, working on Agentic AI technologies and AI-driven solutions for enterprise applications. His work focuses on building AI-powered capabilities, including LLM-based applications, RAG pipelines & intelligent agents. Previously, he worked in the Db2 Text Search and Extenders team, contributing to search and data management capabilities within Db2. His experience across Db2 search technologies and Agentic AI enables him to build intelligent solutions that make Db2 products smarter, more efficient, and easier to use.
Published on the IBM Community Β· IBM Genius Hub Β· IBM Db2 Space Management