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
Describe the issue:
This issue tracks the implementation of several database optimization strategies to enhance query performance and ensure data integrity across various tables. The enhancements will include adding necessary indexes, implementing function-based unique constraints, optimizing primary keys for legacy tables, and analyzing query usage to ensure the applied optimizations are beneficial.
Proposed Solution for Unique Constraints and Function-Based Indexing:
Implement function-based unique indexes for columns requiring case-insensitivity (e.g., LOWER(USER_NAME)). This approach will support case-insensitive searches while maintaining uniqueness and improving performance.
Optimize Primary Keys for Legacy Tables:
CREATETABLEIDN_AUTH_USER (
USER_ID VARCHAR(255) NOT NULL,
USER_NAME VARCHAR(255) NOT NULL,
TENANT_ID INTEGERNOT NULL,
DOMAIN_NAME VARCHAR(255) NOT NULL,
IDP_ID INTEGERNOT NULL,
PRIMARY KEY (USER_ID)
);
-- Function-based unique index for case-insensitivityCREATEUNIQUE INDEXIDX_USER_STORE_UNIQUEON IDN_AUTH_USER (
LOWER(USER_NAME), TENANT_ID, DOMAIN_NAME, IDP_ID
);
For tables with composite primary keys, restructure by introducing an auto-generated primary key column, converting existing primary keys to unique indexes. This change aims to enhance update and retrieval performance.
Analyze Query Usage Before Adding Indexes:
CREATETABLEIDN_IDENTITY_USER_DATA (
ID INTEGER GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
TENANT_ID INTEGER DEFAULT -1234,
USER_NAME VARCHAR(255) NOT NULL,
DATA_KEY VARCHAR(255) NOT NULL,
DATA_VALUE VARCHAR(2048)
);
CREATEUNIQUE INDEXIDX_UNIQUE_LOWER_TENANT_USER_DATAON IDN_IDENTITY_USER_DATA (TENANT_ID, LOWER(USER_NAME), DATA_KEY);
Before applying the proposed indexes, review and analyze query patterns to ensure the new indexes address actual usage requirements and avoid adding unnecessary overhead.
Add a section in deployment configurations and explain the impact of having case sensitive database for usersotre and case insensitive database for the identity and session databases.
The major impact of token table
The text was updated successfully, but these errors were encountered:
We conducted a performance improvement analysis for case-sensitive databases, focusing on the impact of functional indexes. The tests involved fetching data using the LOWER function from a table containing 1M records. Below is a summary of the average execution times observed.
Summary for average execution time:
Without functional index
With functional index
PostgreSQL
50ms
0.040ms
DB2
600ms
7ms
Oracle
70ms
2ms
Removing the Primary Key:
When adding a functional index, a duplicate index is created if a primary key exists on the same column set. To avoid redundancy, we can remove the primary key from such tables. However, doing so may lead to a performance degradation for case-sensitive queries and table joins.
Describe the issue:
This issue tracks the implementation of several database optimization strategies to enhance query performance and ensure data integrity across various tables. The enhancements will include adding necessary indexes, implementing function-based unique constraints, optimizing primary keys for legacy tables, and analyzing query usage to ensure the applied optimizations are beneficial.
Tasks:
Add missing indexes in Oracle Rac script.
Implement function-based unique indexes for columns requiring case-insensitivity (e.g., LOWER(USER_NAME)). This approach will support case-insensitive searches while maintaining uniqueness and improving performance.
Optimize Primary Keys for Legacy Tables:
Current Structure
Proposed Structure
Analyze Query Usage Before Adding Indexes:
Current Structure
Proposed Structure
The text was updated successfully, but these errors were encountered: