監控專案,16個傳感器,采樣頻率50hz, 建了一個表存盤資料,結構簡單:時間+ 數值
Create Table real_data(
record_time timestamp(3),
ac_1 Float,
ac_2 Float,
ac_3 Float,
ac_4 Float,
ac_5 Float,
ac_6 Float,
ac_7 Float,
ac_8 Float,
ac_9 Float,
ac_10 Float,
ac_11 Float,
ac_12 Float,
ac_13 Float,
ac_14 Float,
ac_15 Float,
ac_16 Float
)
Tablespace data_test;
每10分鐘有一個job 從將該表的資料 移到 另一張表中去。
現在有個業務邏輯是 客戶端 每20ms 或者40ms 取該表的最新的一條資料。
陳述句為:
select RECORD_TIME,ac_6 from (select RECORD_TIME,ac_6 from ac_real_data order by record_time desc) where rownum<=1 order by record_time desc
現 出來的結果, 每3-4次查詢的 的資料 是一樣的,然后時間突然跳變。 但是情況是 這個表 20ms 就有資料插入,基本沒有延遲。
2017-02-23 15:38:53,569 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,600 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,661 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,693 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,723 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,756 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,786 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,816 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,847 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,887 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,924 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,958 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:53,994 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:54,039 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:20 320
2017-02-23 15:38:54,390 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,466 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,507 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,550 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,584 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,635 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,675 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,707 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
2017-02-23 15:38:54,755 [ 8] DEBUG testchart.Window1: time is 2017-02-23 15:35:23 320
這個是怎么回事? 謝謝!
uj5u.com熱心網友回復:
但是情況是 這個表 20ms 就有資料插入,基本沒有延遲。有資料洗掉嗎? 如果把最早的資料洗掉了,你這個查詢陳述句,的結果也會發生變化;
uj5u.com熱心網友回復:
不行的話,就使用row_number()over()uj5u.com熱心網友回復:
有資料轉移的,我會10分鐘把這個表 中的當前時間前2分鐘的資料轉移到另一個表,并洗掉的。
我在10分鐘沒有任何操作的程序中,按這種方式查詢過,還是這樣的
uj5u.com熱心網友回復:
謝謝!
能否具體一點。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/103464.html
標籤:高級技術
上一篇:java.sql.SQLException: ORA-00600: internal error code, arguments: [kkpamRFGet0]
