-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Description
We are currently managing a large number of tables (964) in our database, with expectations for continued growth. We've encountered a significant performance issue when attempting to retrieve the list of tables using the SELECT * FROM information_schema.tables query. This operation is taking over 30 seconds to complete, which is causing concerns about efficiency and scalability.
Context
- Current number of tables: 964
- Expected: Continued growth in the number of tables
- Current behavior:
DROP TABLEandCREATE TABLEoperations do not supportIF NOT EXISTSorIF EXISTSclauses - Workaround attempt: Using
SELECT * FROM information_schema.tablesto check table existence - Problem: This query is taking more than 30 seconds to execute
Impact
The slow retrieval of the table list is affecting our ability to efficiently manage and operate on our database schema. This issue may become more severe as we continue to add more tables to the database.
Questions for Investigation
- Is this query performance normal for the given number of tables?
- Are there any optimizations we can apply to the
information_schema.tablesquery to improve its performance? - Can we implement support for
IF NOT EXISTSandIF EXISTSclauses in ourCREATE TABLEandDROP TABLEoperations to avoid the need for this query? - Are there any index optimizations we can apply to improve the performance of metadata queries?
- Is there an alternative method to efficiently check for table existence without querying the entire table list?
- How does this query performance scale with an increasing number of tables?
Additional Information
- While other queries are running concurrently, the time taken for retrieving the table list seems disproportionately long.
- We need to find a solution that scales well as our database continues to grow.
Next Steps
We would appreciate insights from the team on:
- Potential causes of this performance issue
- Recommended approaches for investigation
- Possible solutions or optimizations to improve the table list retrieval performance
Any additional context or suggestions for improving our database management approach would be greatly appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels