從資料庫中快速查詢對應資訊

2021-08-19 11:48:32 字數 615 閱讀 5332

昨天我需要修改介面dto的屬性與資料庫中的字段匹配,我採用的是直接查詢注釋的方式,大部分寫了注釋的都能輕鬆找到。其他的需要通過理解表與表之間的關係才能找到對應字段。比如我需要查詢「檢測人員名稱"屬性,就需要考慮通過程式入口的那個表的「員工id」欄位來查詢「員工名稱「。這時候用查注釋的方式就不管用了,需要理解表結構。

-- 根據注釋查詢

select  column_name,table_name,data_type,column_comment from information_schema.columns  where column_comment like '%自動加入工單%';

-- 根據表名查詢

select  column_name,table_name,data_type,column_comment from information_schema.columns  where table_name='hc_basic_tyre_problem';

-- 根據列名查詢

select  column_name,table_name,data_type,column_comment from information_schema.columns  where column_name like '%id%';

怎麼從海量資料中快速查詢某個資料 索引

mysql 底層依賴的是 b 樹這種資料結構。那類似 redis 這樣的 key value 資料庫中的索引,又是怎麼實現的呢?底層依賴的又是什麼資料結構呢?索引這種常用的技術解決思路,底層往往會依賴哪些資料結構。同時,通過索引這個應用場景,你學過過或者知道幾種支援動態集合的資料結構呢?在實際的軟體...

資料庫資訊查詢

查詢某欄位型別 select information schema.columns.data typeinto ls type from information schema.columns where information schema.columns.table name tablename ...

快速查詢表中的NULL資料

正常情況下,null值是不會放入b tree索引的,因此根據is null查詢的時候走的通常是全表掃瞄,如果記錄比較少還好,記錄比較多,查詢會非常耗時 可以通過建立乙個索引來解決 create index table owner.ix table name col on table owner.ta...