V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
insert000
V2EX  ›  MySQL

Navicat 支持用正则表达式搜索表名嘛?

  •  
  •   insert000 · Jan 25, 2024 · 1240 views
    This topic created in 829 days ago, the information mentioned may be changed or developed.

    我想按表前缀 + 租户后缀匹配业务表 ,现在使用得 heidiSQL 工具 是支持这种检索,^component_.*_10000$。 不知道 Navicat 是否能实现这样得搜索,在哪操作

    5200
        1
    5200  
       Jan 25, 2024
    可以的,
    ![1e2b92b2086d4093312c76f667a32daa.png]( https://i.miji.bid/2024/01/25/1e2b92b2086d4093312c76f667a32daa.png)![5ae2e3049a0cdc644fde9d333c31f054.png]( https://i.miji.bid/2024/01/25/5ae2e3049a0cdc644fde9d333c31f054.png)
    insert000
        2
    insert000  
    OP
       Jan 25, 2024
    @5200 搜索不动,一检索就卡死了 。表名检索应该不至于吧。。。
    5200
        3
    5200  
       Jan 25, 2024
    @insert000 #2 查询范围之类的记得看看,默认是查询全部数据了
    SilenceLL
        4
    SilenceLL  
       Jan 25, 2024
    SELECT * FROM information_schema.STATISTICS WHERE table_schema= DATABASE() AND TABLE_NAME LIKE 'component_%_10000';
    这样子满足吗
    insert000
        5
    insert000  
    OP
       Jan 25, 2024
    @SilenceLL 这样是可以查看,我平时使用场景 需要频繁切换不同租户和业务 ,写 SQL 来找表 然后看数据 ,这样交互操作太耗时
    SilenceLL
        6
    SilenceLL  
       Jan 26, 2024
    @insert000 #5 可以考虑建路由表,租户 id 和业务表的路由关系
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2367 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 10:37 · PVG 18:37 · LAX 03:37 · JFK 06:37
    ♥ Do have faith in what you're doing.