You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "makssent (via GitHub)" <gi...@apache.org> on 2025/09/03 17:07:13 UTC

Re: [I] filters out user tables with "$" in names as system tables [shardingsphere]

makssent commented on issue #36462:
URL: https://github.com/apache/shardingsphere/issues/36462#issuecomment-3250074272

   I forgot to mention that this issue occurs when working with tables defined using `!SINGLE`.
   I don’t know why, but when using tables through `broadcastTables` everything works fine. I’m not sure what the difference is — I’ll investigate further how `broadcastTables` are parsed, maybe they don’t go through this check.
   
   I tried a couple of ideas today to solve this problem, but none of them were successful:
   
   - `Option 1. Use SystemSchemaManager:` The first idea was to directly call the `isSystemTable` function from `SystemSchemaManager` inside `SchemaMetaDataLoader`. This would allow us to check whether a table is system using an existing mechanism. But this can’t be done, because it would require using the `infra-common` module, which in turn means reworking all `dependencies` in `pom.xml` and creates build conflicts.
   - `Option 2. New option:` The second idea was to introduce a new option similar to `DialectSchemaOption`, so that each dialect could determine its own system tables. But for just one function, this looks overly excessive and would unnecessarily complicate the architecture.
   - `Option 3. Adjust the current rule:` The third idea was to change the current rule in `isSystemTable` so that it is dialect-specific, rather than universal (`contains("$")`). The problem is that there really is no universal rule: In `Firebird`, for example, a user can create a table `RDB$REL`, even though there is already a system table `RDB$RELATIONS`. That means users are allowed to create tables with the `RDB$*` prefix, and a blanket filter on `$` or even on `RDB$` would result in false positives.
   - `Option 4. Use YAML system table lists:` Another idea was to rely on the YAML system table lists that already exist for each dialect. But this is also not a good solution: a similar implementation already exists in `SystemSchemaManager`, and duplicating it in `SchemaMetaDataLoader` would mean adding yet another parser and logic for YAML handling, which would be redundant and “hacky” from an architectural point of view.
   
   At the same time, completely removing the rule at the schema loading stage is also not an option. If we load all tables first and only filter them later, it means unnecessary system objects will be fetched initially and then discarded. That’s extra operations, wasted time, and degraded performance during Proxy startup.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org