主頁 > 資料庫 > [20201117]使用DBMS_SHARED_POOL.MARKHOT與sql陳述句6.txt

[20201117]使用DBMS_SHARED_POOL.MARKHOT與sql陳述句6.txt

2020-11-17 16:52:25 資料庫

[20201117]使用DBMS_SHARED_POOL.MARKHOT與sql陳述句6.txt

--//前幾天我看了鏈接:https://blog.pythian.com/reducing-contention-on-hot-cursor-objects-cursor-pin-s/
--//里面提到使用DBMS_SHARED_POOL.MARKHOT標識sql陳述句,減少Cursor: Pin S的情況,不過對方不同的地方是在函式中使用,
--//我以前的測驗不在函式里面反而更慢,不建議使用,出現大量的"library cache: mutex X".
--//正好里面有例子,我直接拿來測驗看看,

1.環境:
SCOTT@book> @ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production


2.建立測驗環境:

create table job_times (sid number, sessionid number,time_ela number,method varchar2(20));
create table code_table (code_name char(1), low_value number, high_value number);

create unique index pk_code_table on scott.code_table(code_name);
alter table code_table add constraint pk_code_table  primary key (code_name);
--//作者的測驗不建立主鍵索引,我的測驗建立它,

declare
  letters char(26) := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
  v_num number := 1;
begin
  for i in 1..26 LOOP
    insert into code_table values (substr(letters,i,1), i*v_num, i*(v_num+1000));
    v_num := v_num + 1001;
  end loop;
  commit;
end;
/

create or replace function fx_num (v_name varchar) return number is
   v_low number;
   v_high number;
begin
   select low_value, high_value into v_low, v_high from code_table where code_name=v_name;
    return( v_high-v_low);
--//return(DBMS_RANDOM.value(low => v_low, high => v_high));
end;
/
--//注:我發現作者寫的例子不是很好,呼叫DBMS_RANDOM函式,導致函式本身執行時間有點"長",

--//建立測驗腳本m3.txt:
$ cat m3.txt
set verify off
insert into job_times values ( sys_context ('userenv', 'sid') ,sys_context ('userenv', 'sessionid'),dbms_utility.get_time ,'&&2') ;
commit ;
declare
v_id number;
v_d date;
m_rowid varchar2(20);
m_data varchar2(32);
begin
--//    m_rowid := '&3';
    for i in 1 .. &&1 loop
                select /*+ &3 */ fx_num(substr(to_char(sysdate,'MON'),1,1)) into v_id from  dual;
    end loop;
end ;
/
update job_times set time_ela = dbms_utility.get_time - time_ela where sid=sys_context ('userenv', 'sid') and sessionid=sys_context ('userenv', 'sessionid') and method='&&2';
commit;

$ cat cc.txt
SELECT owner
      ,name
      ,hash_value
      ,full_hash_value
      ,namespace
      ,child_latch
      ,property hot_flag
      ,executions
      ,invalidations
  FROM v$db_object_cache
 WHERE name = 'SELECT LOW_VALUE, HIGH_VALUE FROM CODE_TABLE WHERE CODE_NAME=:B1 '
 order by executions desc ;
--//注意/:B1后面有1個空格,

$ cat cd.txt
column NAMESPACE format a20
column HOT_FLAG  format a20
column name format a66
SELECT owner
      ,name
      ,hash_value
      ,full_hash_value
      ,namespace
      ,child_latch
      ,property hot_flag
      ,executions
      ,invalidations
  FROM v$db_object_cache
 WHERE  name='FX_NUM'
 order by executions desc ;

 
3.測驗:
--//執行:
SYS@book> @ tpt/snapper ash 65 1  "select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1"
Sampling SID select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1 with interval 65 seconds, taking 1 snapshots...
-- Session Snapper v4.11 BETA - by Tanel Poder ( http://blog.tanelpoder.com ) - Enjoy the Most Advanced Oracle Troubleshooting Script on the Planet! :)
----------------------------------------------------------------------------------------------------
Active% | INST | SQL_ID          | SQL_CHILD | EVENT                               | WAIT_CLASS
----------------------------------------------------------------------------------------------------
   993% |    1 |                 |           | library cache: mutex X              | Concurrency
   517% |    1 | 7tr4jwnamtmsr   | 0         | ON CPU                              | ON CPU
   255% |    1 |                 |           | ON CPU                              | ON CPU
    42% |    1 | ctyugp3su3k91   | 0         | library cache: mutex X              | Concurrency
    42% |    1 | 1zvmjk9k3sp2m   | 0         | library cache: mutex X              | Concurrency
    42% |    1 | 158y7v912v8fb   | 0         | library cache: mutex X              | Concurrency
    41% |    1 | 3mbun480b7ccy   | 0         | library cache: mutex X              | Concurrency
    40% |    1 | 4r4k676qa6v2d   | 0         | library cache: mutex X              | Concurrency
    39% |    1 | 3k7xkc2t9fwf6   | 0         | library cache: mutex X              | Concurrency
    39% |    1 | 8t7czzgnugs5x   | 0         | library cache: mutex X              | Concurrency
--  End of ASH snap 1, end=2020-11-17 15:57:47, seconds=65, samples_taken=99
PL/SQL procedure successfully completed.

--//馬上打開另外會話執行:
$ zzdate ;seq 50 | xargs -I{} -P 50 sqlplus -s -l scott/book @m3.txt 2e5 unmarkhot_p=50 {} >/dev/null ;zzdate
trunc(sysdate)+15/24+56/1440+40/86400 == 2020/11/17 15:56:40
trunc(sysdate)+15/24+57/1440+42/86400 == 2020/11/17 15:57:42

SYS@book> @ tpt/ash/ash_wait_chains username||':'||program2||event2 module='SQL*Plus' trunc(sysdate)+15/24+56/1440+40/86400 trunc(sysdate)+15/24+57/1440+42/86400
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This     SECONDS        AAS WAIT_CHAIN
------ ---------- ---------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  41%        1249       20.1 -> SCOTT:(sqlplus) ON CPU
  32%         984       15.9 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
  22%         675       10.9 -> SCOTT:(sqlplus) library cache: mutex X
   3%          87        1.4 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
   3%          80        1.3 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
   0%           2          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
   0%           1          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
7 rows selected.
--//從等待事件看出現大量的library cache: mutex X,實際上在做到這里時就懷疑作者的測驗,因為sql陳述句出現等待集中在cursor: pin S,
--//而測驗出現library cache: mutex X,說明主要還是集中在包或者函式上,我估計標識sql陳述句后效果不會太好,

4.標識熱物件SQL陳述句:
SYS@book> @ cc.txt
OWNER  NAME                                                               HASH_VALUE FULL_HASH_VALUE                  NAMESPACE            CHILD_LATCH HOT_FLAG             EXECUTIONS INVALIDATIONS
------ ------------------------------------------------------------------ ---------- -------------------------------- -------------------- ----------- -------------------- ---------- -------------
       SELECT LOW_VALUE, HIGH_VALUE FROM CODE_TABLE WHERE CODE_NAME=:B1    356306711 eb4cdceda1c495cd7cdc91e5153ccf17 SQL AREA                   53015                        37338848             0
       SELECT LOW_VALUE, HIGH_VALUE FROM CODE_TABLE WHERE CODE_NAME=:B1    356306711 eb4cdceda1c495cd7cdc91e5153ccf17 SQL AREA                       0                        36943000             0
--//CHILD_LATCH是FULL_HASH_VALUE的后17位 0xcf17 = 53015,

SYS@book> exec dbms_shared_pool.markhot(hash => 'eb4cdceda1c495cd7cdc91e5153ccf17', namespace => 0, global => true);
PL/SQL procedure successfully completed.
       
5.繼續測驗:
SYS@book> @ tpt/snapper ash 65 1  "select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1"
Sampling SID select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1 with interval 65 seconds, taking 1 snapshots...
-- Session Snapper v4.11 BETA - by Tanel Poder ( http://blog.tanelpoder.com ) - Enjoy the Most Advanced Oracle Troubleshooting Script on the Planet! :)
----------------------------------------------------------------------------------------------------
Active% | INST | SQL_ID          | SQL_CHILD | EVENT                               | WAIT_CLASS
----------------------------------------------------------------------------------------------------
  1130% |    1 |                 |           | library cache: mutex X              | Concurrency
   234% |    1 |                 |           | ON CPU                              | ON CPU
    76% |    1 | dc8x5k16dsk82   | 0         | ON CPU                              | ON CPU
    76% |    1 | 9pyrc45h3tgg9   | 0         | ON CPU                              | ON CPU
    65% |    1 | 0u9hxt3azayv5   | 0         | ON CPU                              | ON CPU
    62% |    1 | arg5wx08suqm0   | 0         | ON CPU                              | ON CPU
    55% |    1 | cqtdnxg9apfza   | 0         | ON CPU                              | ON CPU
    49% |    1 | 3k7xkc2t9fwf6   | 0         | library cache: mutex X              | Concurrency
    46% |    1 | 61m38g7ygpfvz   | 0         | ON CPU                              | ON CPU
    44% |    1 | 2ht2a25wq37kg   | 0         | library cache: mutex X              | Concurrency
--  End of ASH snap 1, end=2020-11-17 16:03:21, seconds=65, samples_taken=98
PL/SQL procedure successfully completed.


$ zzdate ;seq 50 | xargs -I{} -P 50 sqlplus -s -l scott/book @m3.txt 2e5 markhot_p=50 {} >/dev/null ;zzdate
trunc(sysdate)+16/24+02/1440+17/86400 == 2020/11/17 16:02:17
trunc(sysdate)+16/24+03/1440+18/86400 == 2020/11/17 16:03:18
--//從時間上看并沒有體現使用DBMS_SHARED_POOL.MARKHOT的好處,

SYS@book> @ tpt/ash/ash_wait_chains username||':'||program2||event2 module='SQL*Plus' trunc(sysdate)+16/24+02/1440+17/86400 trunc(sysdate)+16/24+03/1440+18/86400
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This     SECONDS        AAS WAIT_CHAIN
------ ---------- ---------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43%        1289       21.1 -> SCOTT:(sqlplus) ON CPU
  33%         994       16.3 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
  19%         570        9.3 -> SCOTT:(sqlplus) library cache: mutex X
   2%          57         .9 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
   2%          54         .9 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
   0%           5         .1 -> SCOTT:(sqlplus) cursor: pin S
   0%           1          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
   0%           1          0 -> SCOTT:(sqlplus) cursor: pin S  -> SCOTT:(sqlplus) ON CPU
   0%           1          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
   0%           1          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) cursor: pin S
   0%           1          0 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
11 rows selected.

SCOTT@book> Select method,count(*),round(avg(TIME_ELA),0),sum(TIME_ELA) from job_times group by method order by 3 ;
METHOD                 COUNT(*) ROUND(AVG(TIME_ELA),0) SUM(TIME_ELA)
-------------------- ---------- ---------------------- -------------
markhot_p=50                 50                   5989        299426
unmarkhot_p=50               50                   6118        305892

--//根本無法體會dbms_shared_pool.markhot的好處,

6.標識函式為熱物件呢?
SCOTT@book> @ cd.txt
OWNER  NAME    HASH_VALUE FULL_HASH_VALUE                  NAMESPACE            CHILD_LATCH HOT_FLAG             EXECUTIONS INVALIDATIONS
------ ------- ---------- -------------------------------- -------------------- ----------- -------------------- ---------- -------------
SCOTT  FX_NUM  3934649448 e946e63d9c1e58dd062f52adea85fc68 TABLE/PROCEDURE           130152                        50000000             0

SYS@book> exec dbms_shared_pool.markhot(hash => 'e946e63d9c1e58dd062f52adea85fc68', namespace => 1, global => true);
PL/SQL procedure successfully completed.

SYS@book> @ tpt/snapper ash 65 1  "select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1"
Sampling SID select inst_id,sid from gv$session where username='SCOTT' and program like 'sqlplus%' and inst_id=1 with interval 65 seconds, taking 1 snapshots...
-- Session Snapper v4.11 BETA - by Tanel Poder ( http://blog.tanelpoder.com ) - Enjoy the Most Advanced Oracle Troubleshooting Script on the Planet! :)
----------------------------------------------------------------------------------------------------
Active% | INST | SQL_ID          | SQL_CHILD | EVENT                               | WAIT_CLASS
----------------------------------------------------------------------------------------------------
   309% |    1 |                 |           | ON CPU                              | ON CPU
   114% |    1 |                 |           | library cache: mutex X              | Concurrency
   106% |    1 | 0u9hxt3azayv5   | 0         | ON CPU                              | ON CPU
   101% |    1 | dc8x5k16dsk82   | 0         | ON CPU                              | ON CPU
    97% |    1 | arg5wx08suqm0   | 0         | ON CPU                              | ON CPU
    95% |    1 | cqtdnxg9apfza   | 0         | ON CPU                              | ON CPU
    88% |    1 | 9pyrc45h3tgg9   | 0         | ON CPU                              | ON CPU
    64% |    1 | 5bacfy8mwthrj   | 0         | ON CPU                              | ON CPU
    54% |    1 | 61m38g7ygpfvz   | 0         | ON CPU                              | ON CPU
    36% |    1 | 0srq6bz2rvktx   | 0         | ON CPU                              | ON CPU
--  End of ASH snap 1, end=2020-11-17 16:10:06, seconds=65, samples_taken=99
PL/SQL procedure successfully completed.

$ zzdate ;seq 50 | xargs -I{} -P 50 sqlplus -s -l scott/book @m3.txt 2e5 markhot_pfs=50 {} >/dev/null ;zzdate
trunc(sysdate)+16/24+09/1440+02/86400 == 2020/11/17 16:09:02
trunc(sysdate)+16/24+09/1440+45/86400 == 2020/11/17 16:09:45

SYS@book> @ tpt/ash/ash_wait_chains username||':'||program2||event2 module='SQL*Plus' trunc(sysdate)+16/24+09/1440+02/86400 trunc(sysdate)+16/24+09/1440+45/86400
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This     SECONDS        AAS WAIT_CHAIN
------ ---------- ---------- -------------------------------------------------------------------------------------
  84%        1767       41.1 -> SCOTT:(sqlplus) ON CPU
  11%         234        5.4 -> SCOTT:(sqlplus) library cache: mutex X
   4%          77        1.8 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) ON CPU
   1%          15         .3 -> SCOTT:(sqlplus) cursor: pin S  -> SCOTT:(sqlplus) ON CPU
   0%           4         .1 -> SCOTT:(sqlplus) library cache: mutex X  -> SCOTT:(sqlplus) library cache: mutex X
   0%           3         .1 -> SCOTT:(sqlplus) cursor: pin S
6 rows selected.
--//依舊存在少量library cache: mutex X,
SCOTT@book> @ cd.txt
OWNER  NAME   HASH_VALUE FULL_HASH_VALUE                  NAMESPACE            CHILD_LATCH HOT_FLAG             EXECUTIONS INVALIDATIONS
------ ------ ---------- -------------------------------- -------------------- ----------- -------------------- ---------- -------------
SCOTT  FX_NUM 3934649448 e946e63d9c1e58dd062f52adea85fc68 TABLE/PROCEDURE           130152 HOT                    50000000             0
SCOTT  FX_NUM 2604013040 acab658d7761882204bcbd0b9b3615f0 TABLE/PROCEDURE             5616 HOTCOPY1                1400000             0
SCOTT  FX_NUM 1147571161 5bc0190cffaf491d2cc98bda44668bd9 TABLE/PROCEDURE            35801 HOTCOPY6                1400000             0
SCOTT  FX_NUM 2514462761 4046d059eca2403b2f1031c395dfa829 TABLE/PROCEDURE           108585 HOTCOPY11               1400000             0
SCOTT  FX_NUM 2255211854 685056ffeb2dead33b91453e866bcd4e TABLE/PROCEDURE           118094 HOTCOPY9                1200000             0
SCOTT  FX_NUM 1128717707 5e9cc5f89e3a3b6fa14956904346dd8b TABLE/PROCEDURE            56715 HOTCOPY4                1200000             0
SCOTT  FX_NUM 3773218966 44b816a2374a4ecfd1c80ca4e0e6c096 TABLE/PROCEDURE            49302 HOTCOPY7                 800000             0
SCOTT  FX_NUM 1509772016 5aa610021f96b19db8b56a4459fd4af0 TABLE/PROCEDURE            84720 HOTCOPY2                 800000             0
SCOTT  FX_NUM  385266949 97923d5d4cfc8cfd6175dca316f6b505 TABLE/PROCEDURE            46341 HOTCOPY3                 600000             0
SCOTT  FX_NUM 2652599427 ef67af593682efa5dbecd4ee9e1b7483 TABLE/PROCEDURE            95363 HOTCOPY8                 400000             0
SCOTT  FX_NUM 1752733049 2a5adce93042ee1fd233ef8668789579 TABLE/PROCEDURE            38265 HOTCOPY12                400000             0
SCOTT  FX_NUM 2357479237 9b6f379c93c9312cab9a22be8c844745 TABLE/PROCEDURE            18245 HOTCOPY5                 400000             0
12 rows selected.
--//我并行50個會話,僅僅打開11個hotcopy,依舊存在爭用,從EXECUTIONS次數也可以看出來,

SCOTT@book> Select method,count(*),round(avg(TIME_ELA),0),sum(TIME_ELA) from job_times group by method order by 3 ;
METHOD                 COUNT(*) ROUND(AVG(TIME_ELA),0) SUM(TIME_ELA)
-------------------- ---------- ---------------------- -------------
markhot_pfs=50               50                   4190        209483
markhot_p=50                 50                   5989        299426
unmarkhot_p=50               50                   6118        305892

7.總結:
從測驗可以看出,使用dbms_shared_pool.markhot標識sql陳述句帶來的效果不是很大,主要遇到http://blog.itpub.net/267265/viewspace-2675362/的bug,
利益還是在于鏈接http://blog.itpub.net/267265/viewspace-2675377/的總結,再次轉抄一遍(原始鏈接有1個地方寫錯):

1.使用DBMS_SHARED_POOL.MARKHOT標識熱sql陳述句,反而性能更慢,我估計可能遇到bug,
參考鏈接:http://blog.itpub.net/267265/viewspace-2675362/=>[20200212]使用DBMS_SHARED_POOL.MARKHOT與視圖v$open_cursor.txt

2.使用DBMS_SHARED_POOL.MARKHOT標識熱物件,效果不錯,如果頻繁呼叫可以嘗試使用,
--//這里原始鏈接有錯,

3.關于FULL_HASH_VALUE的計算:
--// sql陳述句 在原來的基礎上加入 . mod(sid,cpu_count/2)+1數字的字串 參與運算,
--// 如果設定隱含引數 _kgl_hot_object_copies, sql陳述句 在原來的基礎上加入 . mod(sid,_kgl_hot_object_copies)+1數字的字串,
--// 物件    object_name.owner.HOTCOPYNN中的NN \0X\0\0\0 (其中X標識namespace),
--//另外 namespace可以查詢  select distinct kglhdnsp,kglhdnsd,kglobtyd from x$kglob order by 1;

測驗參考鏈接:
http://andreynikolaev.wordpress.com/2011/05/01/divide-and-conquer-the-true-mutex-contention/
https://jonathanlewis.wordpress.com/2017/10/02/markhot/

轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/222257.html

標籤:其他

上一篇:安裝MySQL5.7

下一篇:因退休太無聊,Python創始人加入微軟!

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • GPU虛擬機創建時間深度優化

    **?桔妹導讀:**GPU虛擬機實體創建速度慢是公有云面臨的普遍問題,由于通常情況下創建虛擬機屬于低頻操作而未引起業界的重視,實際生產中還是存在對GPU實體創建時間有苛刻要求的業務場景。本文將介紹滴滴云在解決該問題時的思路、方法、并展示最終的優化成果。 從公有云服務商那里購買過虛擬主機的資深用戶,一 ......

    uj5u.com 2020-09-10 06:09:13 more
  • 可編程網卡芯片在滴滴云網路的應用實踐

    **?桔妹導讀:**隨著云規模不斷擴大以及業務層面對延遲、帶寬的要求越來越高,采用DPDK 加速網路報文處理的方式在橫向縱向擴展都出現了局限性。可編程芯片成為業界熱點。本文主要講述了可編程網卡芯片在滴滴云網路中的應用實踐,遇到的問題、帶來的收益以及開源社區貢獻。 #1. 資料中心面臨的問題 隨著滴滴 ......

    uj5u.com 2020-09-10 06:10:21 more
  • 滴滴資料通道服務演進之路

    **?桔妹導讀:**滴滴資料通道引擎承載著全公司的資料同步,為下游實時和離線場景提供了必不可少的源資料。隨著任務量的不斷增加,資料通道的整體架構也隨之發生改變。本文介紹了滴滴資料通道的發展歷程,遇到的問題以及今后的規劃。 #1. 背景 資料,對于任何一家互聯網公司來說都是非常重要的資產,公司的大資料 ......

    uj5u.com 2020-09-10 06:11:05 more
  • 滴滴AI Labs斬獲國際機器翻譯大賽中譯英方向世界第三

    **桔妹導讀:**深耕人工智能領域,致力于探索AI讓出行更美好的滴滴AI Labs再次斬獲國際大獎,這次獲獎的專案是什么呢?一起來看看詳細報道吧! 近日,由國際計算語言學協會ACL(The Association for Computational Linguistics)舉辦的世界最具影響力的機器 ......

    uj5u.com 2020-09-10 06:11:29 more
  • MPP (Massively Parallel Processing)大規模并行處理

    1、什么是mpp? MPP (Massively Parallel Processing),即大規模并行處理,在資料庫非共享集群中,每個節點都有獨立的磁盤存盤系統和記憶體系統,業務資料根據資料庫模型和應用特點劃分到各個節點上,每臺資料節點通過專用網路或者商業通用網路互相連接,彼此協同計算,作為整體提供 ......

    uj5u.com 2020-09-10 06:11:41 more
  • 滴滴資料倉庫指標體系建設實踐

    **桔妹導讀:**指標體系是什么?如何使用OSM模型和AARRR模型搭建指標體系?如何統一流程、規范化、工具化管理指標體系?本文會對建設的方法論結合滴滴資料指標體系建設實踐進行解答分析。 #1. 什么是指標體系 ##1.1 指標體系定義 指標體系是將零散單點的具有相互聯系的指標,系統化的組織起來,通 ......

    uj5u.com 2020-09-10 06:12:52 more
  • 單表千萬行資料庫 LIKE 搜索優化手記

    我們經常在資料庫中使用 LIKE 運算子來完成對資料的模糊搜索,LIKE 運算子用于在 WHERE 子句中搜索列中的指定模式。 如果需要查找客戶表中所有姓氏是“張”的資料,可以使用下面的 SQL 陳述句: SELECT * FROM Customer WHERE Name LIKE '張%' 如果需要 ......

    uj5u.com 2020-09-10 06:13:25 more
  • 滴滴Ceph分布式存盤系統優化之鎖優化

    **桔妹導讀:**Ceph是國際知名的開源分布式存盤系統,在工業界和學術界都有著重要的影響。Ceph的架構和演算法設計發表在國際系統領域頂級會議OSDI、SOSP、SC等上。Ceph社區得到Red Hat、SUSE、Intel等大公司的大力支持。Ceph是國際云計算領域應用最廣泛的開源分布式存盤系統, ......

    uj5u.com 2020-09-10 06:14:51 more
  • es~通過ElasticsearchTemplate進行聚合~嵌套聚合

    之前寫過《es~通過ElasticsearchTemplate進行聚合操作》的文章,這一次主要寫一個嵌套的聚合,例如先對sex集合,再對desc聚合,最后再對age求和,共三層嵌套。 Aggregations的部分特性類似于SQL語言中的group by,avg,sum等函式,Aggregation ......

    uj5u.com 2020-09-10 06:14:59 more
  • 爬蟲日志監控 -- Elastc Stack(ELK)部署

    傻瓜式部署,只需替換IP與用戶 導讀: 現ELK四大組件分別為:Elasticsearch(核心)、logstash(處理)、filebeat(采集)、kibana(可視化) 下載均在https://www.elastic.co/cn/downloads/下tar包,各組件版本最好一致,配合fdm會 ......

    uj5u.com 2020-09-10 06:15:05 more
最新发布
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:33:24 more
  • MySQL中binlog備份腳本分享

    關于MySQL的二進制日志(binlog),我們都知道二進制日志(binlog)非常重要,尤其當你需要point to point災難恢復的時侯,所以我們要對其進行備份。關于二進制日志(binlog)的備份,可以基于flush logs方式先切換binlog,然后拷貝&壓縮到到遠程服務器或本地服務器 ......

    uj5u.com 2023-04-20 08:28:06 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:27:27 more
  • 快取與資料庫雙寫一致性幾種策略分析

    本文將對幾種快取與資料庫保證資料一致性的使用方式進行分析。為保證高并發性能,以下分析場景不考慮執行的原子性及加鎖等強一致性要求的場景,僅追求最終一致性。 ......

    uj5u.com 2023-04-20 08:26:48 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:26:35 more
  • 云時代,MySQL到ClickHouse資料同步產品對比推薦

    ClickHouse 在執行分析查詢時的速度優勢很好的彌補了MySQL的不足,但是對于很多開發者和DBA來說,如何將MySQL穩定、高效、簡單的同步到 ClickHouse 卻很困難。本文對比了 NineData、MaterializeMySQL(ClickHouse自帶)、Bifrost 三款產品... ......

    uj5u.com 2023-04-20 08:26:29 more
  • sql陳述句優化

    問題查找及措施 問題查找 需要找到具體的代碼,對其進行一對一優化,而非一直把關注點放在服務器和sql平臺 降低簡化每個事務中處理的問題,盡量不要讓一個事務拖太長的時間 例如檔案上傳時,應將檔案上傳這一步放在事務外面 微軟建議 4.啟動sql定時執行計劃 怎么啟動sqlserver代理服務-百度經驗 ......

    uj5u.com 2023-04-20 08:25:13 more
  • Redis 報”OutOfDirectMemoryError“(堆外記憶體溢位)

    Redis 報錯“OutOfDirectMemoryError(堆外記憶體溢位) ”問題如下: 一、報錯資訊: 使用 Redis 的業務介面 ,產生 OutOfDirectMemoryError(堆外記憶體溢位),如圖: 格式化后的報錯資訊: { "timestamp": "2023-04-17 22: ......

    uj5u.com 2023-04-20 08:24:54 more
  • day02-2-商鋪查詢快取

    功能02-商鋪查詢快取 3.商鋪詳情快取查詢 3.1什么是快取? 快取就是資料交換的緩沖區(稱作Cache),是存盤資料的臨時地方,一般讀寫性能較高。 快取的作用: 降低后端負載 提高讀寫效率,降低回應時間 快取的成本: 資料一致性成本 代碼維護成本 運維成本 3.2需求說明 如下,當我們點擊商店詳 ......

    uj5u.com 2023-04-20 08:24:03 more
  • day02-短信登錄

    功能實作02 2.功能01-短信登錄 2.1基于Session實作登錄 2.1.1思路分析 2.1.2代碼實作 2.1.2.1發送短信驗證碼 發送短信驗證碼: 發送驗證碼的介面為:http://127.0.0.1:8080/api/user/code?phone=xxxxx<手機號> 請求方式:PO ......

    uj5u.com 2023-04-20 08:23:11 more