Database Column Data Type Conversion for Storage Efficiency
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In relational database management systems, columns with inappropriate data types lead to inefficiencies, such as increased storage space requirements and inefficient query evaluation, due to erroneous data modeling or changes in the data model during system operation.
Innovation Solution
A computer-implemented method that detects mismatching type definitions in database columns using usage statistics, determines if conversion is possible, and converts values to a more appropriate data type, appending a new column and registering it in the metadata catalog while generating query plan operators for efficient processing.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If columns are stored with inappropriate data types (e.g., numeric values as character strings), then storage flexibility and ease of data modeling are improved, but storage space efficiency and query evaluation efficiency deteriorate
Solution Approach 1:
The system automatically detects columns with inappropriate data types and converts them to appropriate types (e.g., from VARCHAR to INT or DECIMAL). This parameter change in data type resolution directly reduces storage space requirements while maintaining data modeling flexibility, as the conversion is transparent to applications and maintains the same logical data model.
2Ease of manufacture
If columns are stored with inappropriate data types, then data modeling ease is improved, but query evaluation efficiency deteriorates due to inefficient operators and conversion operations
Solution Approach 1:
The database system performs self-service by automatically detecting and correcting inappropriate data types without requiring manual intervention from data modelers. The system analyzes column usage patterns and query performance, then autonomously converts data types to optimize query evaluation efficiency while preserving the ease of data modeling that led to the initial inappropriate types.
3Productivity
If data types are converted to appropriate types, then storage efficiency and query efficiency are improved, but system complexity increases due to automatic detection and conversion mechanisms
Solution Approach 1:
The system implements feedback mechanisms by monitoring column usage patterns, query performance metrics, and storage efficiency. This feedback loop enables the automatic detection of inappropriate data types and triggers conversion operations only when beneficial, thereby improving efficiency while managing system complexity through intelligent, data-driven decision-making rather than blanket conversions.
4Productivity
If automatic data type conversion is performed, then inefficiencies are reduced, but risk of affecting existing applications increases
Solution Approach 1:
The system performs preliminary analysis and validation before executing data type conversions. It evaluates the impact on existing applications, checks for data loss risks, and only proceeds with conversions that are safe and beneficial. This preliminary action ensures that system efficiency is improved while application compatibility and reliability are maintained.
Data Source
AI summary
A computer-implemented method, a computer program product, and a computer system for detecting an inappropriate data type of a column in a database and correcting an encoding for the column. The computer system detects in a table a candidate column that has a mismatching type definition, using database usage statistics. The computer system determines whether conversion of the candidate column is possible. In response to determining that the conversion of the candidate column is possible, the computer system converts values in the candidate column with a first data type to values in a new column with a second data type. The computer system appends the new column in the table. The computer system registers the new column and the second data type in a metadata catalog. The computer system generates a query plan operator for processing a query for the new column.


