[db tech showcase Tokyo 2014] D21: Postgres Plus Advanced Serverはここが使える&9.4新機...Insight Technology, Inc.
日本でも徐々に浸透してきたPostgres Plus Advanced Server (PPAS)。PPASが備えている実用的な機能を2014年末にリリース予定の最新版9.4の新機能を交えて、コミュニティ版PostgreSQLと比較しながら解説します。
特に性能面で大きな向上をうたっているパーティショニング機能については実際に検証した結果を紹介します。
【DLゼミ】XFeat: Accelerated Features for Lightweight Image Matchingharmonylab
公開URL:https://arxiv.org/pdf/2404.19174
出典:Guilherme Potje, Felipe Cadar, Andre Araujo, Renato Martins, Erickson R. ascimento: XFeat: Accelerated Features for Lightweight Image Matching, Proceedings of the 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2023)
概要:リソース効率に優れた特徴点マッチングのための軽量なアーキテクチャ「XFeat(Accelerated Features)」を提案します。手法は、局所的な特徴点の検出、抽出、マッチングのための畳み込みニューラルネットワークの基本的な設計を再検討します。特に、リソースが限られたデバイス向けに迅速かつ堅牢なアルゴリズムが必要とされるため、解像度を可能な限り高く保ちながら、ネットワークのチャネル数を制限します。さらに、スパース下でのマッチングを選択できる設計となっており、ナビゲーションやARなどのアプリケーションに適しています。XFeatは、高速かつ同等以上の精度を実現し、一般的なラップトップのCPU上でリアルタイムで動作します。
セル生産方式におけるロボットの活用には様々な問題があるが,その一つとして 3 体以上の物体の組み立てが挙げられる.一般に,複数物体を同時に組み立てる際は,対象の部品をそれぞれロボットアームまたは治具でそれぞれ独立に保持することで組み立てを遂行すると考えられる.ただし,この方法ではロボットアームや治具を部品数と同じ数だけ必要とし,部品数が多いほどコスト面や設置スペースの関係で無駄が多くなる.この課題に対して音𣷓らは組み立て対象物に働く接触力等の解析により,治具等で固定されていない対象物が組み立て作業中に運動しにくい状態となる条件を求めた.すなわち,環境中の非把持対象物のロバスト性を考慮して,組み立て作業条件を検討している.本研究ではこの方策に基づいて,複数物体の組み立て作業を単腕マニピュレータで実行することを目的とする.このとき,対象物のロバスト性を考慮することで,仮組状態の複数物体を同時に扱う手法を提案する.作業対象としてパイプジョイントの組み立てを挙げ,簡易な道具を用いることで単腕マニピュレータで複数物体を同時に把持できることを示す.さらに,作業成功率の向上のために RGB-D カメラを用いた物体の位置検出に基づくロボット制御及び動作計画を実装する.
This paper discusses assembly operations using a single manipulator and a parallel gripper to simultaneously
grasp multiple objects and hold the group of temporarily assembled objects. Multiple robots and jigs generally operate
assembly tasks by constraining the target objects mechanically or geometrically to prevent them from moving. It is
necessary to analyze the physical interaction between the objects for such constraints to achieve the tasks with a single
gripper. In this paper, we focus on assembling pipe joints as an example and discuss constraining the motion of the
objects. Our demonstration shows that a simple tool can facilitate holding multiple objects with a single gripper.
35. EXPLAIN ANALYZE
• 実行計画がそれぞれどれくらい時間かかったか見るこ
とが可能
test=# EXPLAIN ANALYZE SELECT t1.a, t2.a FROM t1, t2 WHERE t1.a = t2.a and t1.a < 100;
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------
Nested Loop (cost=0.85..805.31 rows=95 width=8) (actual time=0.038..3.319 rows=99 loops=1)
-> Index Only Scan using t1_pkey on t1 (cost=0.42..10.09 rows=95 width=4) (actual
time=0.012..0.449 rows=99 loops=1)
Index Cond: (a < 100)
Heap Fetches: 99
-> Index Only Scan using idx_t2_a on t2 (cost=0.42..8.36 rows=1 width=4) (actual time=0.006..0.011
rows=1 loops=99)
Index Cond: (a = t1.a)
Heap Fetches: 99
プランノード
コスト
実行時間
Total runtime: 3.782 ms
(8 rows)
36. やったこと
• 使ってほしいインデックスが使われていないのでクエ
リを書き換え
• インデックスないものは追加
• JOINしたあとにLIMITしていた箇所は、先にLIMITしてか
らJOINするように変更
SELECT *FROM a, b WHERE a.id = b.id and a.hoge >= 1000 LIMIT10;
↓
SELECT* FROM (SELECT * FROM a WHERE a.hoge >= 1000 LIMIT10) as aa,
b WHERE aa.id = b.id
52. 実際に起きたケース(簡略版)
2013-10-30 00:11:22 JST DETAIL: Process 3225 waits for ShareLock on transaction
11759339; blocked by process 3040.
Process 3040 waits for ShareLock on transaction 11759337; blocked by process 3225.
Process 3225:
insert into foo (x,y,z)
select x, 12345, z
from bar
where id in (( values (1), (2), (3) ) except ( select x from foo where date = '...'))
!
Process 3040:
insert into foo (x,y,z)
select x, 12345, z
from bar
where id in (( values (2), (3), (1) ) except( select x from foo where date = '...'))
!
56. BACK TRACE
(gdb) bt
…
#5 0x00000000006f0ada in LockAcquire (locktag=0x7fff7ce28d20, lockmode=5,
sessionLock=0 '000', dontWait=0 '000') at lock.c:662
#6 0x00000000006effec in XactLockTableWait (xid=768) at lmgr.c:495
#7 0x00000000004890e4 in _bt_doinsert (rel=0x7fa0c1634838, itup=0x2122468,
checkUnique=UNIQUE_CHECK_YES, heapRel=0x7fa0c162f820) at nbtinsert.c:168
#8 0x000000000048f3b4 in btinsert (fcinfo=0x7fff7ce28e40) at nbtree.c:257
#9 0x0000000000819bb5 in FunctionCall6Coll (flinfo=0x2115650, collation=0,
arg1=140328416004152, arg2=140735288611488, arg3=140735288611840,
arg4=34743148, arg5=140328415983648, arg6=1) at fmgr.c:1439
#10 0x0000000000487c64 in index_insert (indexRelation=0x7fa0c1634838,
values=0x7fff7ce292a0, isnull=0x7fff7ce29400 "", heap_t_ctid=0x212236c,
heapRelation=0x7fa0c162f820, checkUnique=UNIQUE_CHECK_YES) at indexam.c:216
#11 0x00000000005f29aa in ExecInsertIndexTuples (slot=0x21167c0, tupleid=0x212236c,
estate=0x2115e60) at execUtils.c:1087
#12 0x0000000000605273 in ExecInsert (slot=0x21167c0, planSlot=0x21167c0,
estate=0x2115e60, canSetTag=1 '001') at nodeModifyTable.c:248
57.
58. create table tt(a text unique);
select pg_backend_pid();
begin;
insert into tt values (‘aa’), (‘bb’)
select pg_backend_pid();
begin;
insert into tt values (‘bb’), (‘aa’)
psql
psql
(gdb) b _bt_doinsert
Breakpoint 1 at 0x488fc7: file nbtinsert.c, line 106.
(gdb) c
Continuing.
!
Breakpoint 1, _bt_doinsert (….) at nbtinsert.c:106
(gdb) c
Continuing.
!
Breakpoint 1, _bt_doinsert (….) at nbtinsert.c:106
‘aa’をinsertしたところで止める
(gdb) b _bt_doinsert
Breakpoint 1 at 0x488fc7: file nbtinsert.c, line 106.
(gdb) c
Continuing.
!
Breakpoint 1, _bt_doinsert (….) at nbtinsert.c:106
(gdb) c
Continuing.
!
Breakpoint 1, _bt_doinsert (….) at nbtinsert.c:106
‘bb’をinsertしたところで止める
!
(gdb) c
!
(gdb) c
gdb
gdb
59. 回避方法
2013-10-30 00:11:22 JST DETAIL: Process 3225 waits for ShareLock on transaction
11759339; blocked by process 3040.
Process 3040 waits for ShareLock on transaction 11759337; blocked by process 3225.
Process 3225:
insert into foo (x,y,z)
select x, 12345, z
from bar
where x in (( values (1), (2), (3) ) except ( select x from foo where date = ‘…’))
ORDER BY x
!
Process 3040:
insert into foo (x,y,z)
select x, 12345, z
from bar
where x in (( values (2), (3), (1) ) except( select x from foo where date = ‘...'))
ORDER BY x
!