PostgreSQL XML 1 1 1 1 XML,,, /. XML.,,, PostgreSQL.. Implementation of Yet Another XML-type for PostgreSQL Toshifumi Enomoto, 1 Gengo Suzuki, 1 Nobuyuki Kobayashi 1 and Masashi Yamamuro 1 There are various manipulations for XML data, but most frequent and essential manipulations on XML database are getting and setting values of text nodes or attributes. In case of creating an index, specified values are extracted from all XML data. Therefore, we propose the yet another XML-type implementation that enables to get and set values of text nodes or attributes quickly for PostrgreSQL. 1. XML(eXtensible Markup Language), Web.,, 1 NTT NTT Cyber Space Laboratories, XML,., XML, XML (XMLDB), (RDB)., XML, RDB XMLDB,., XMLDB,., PostgreSQL. 2. 2.1 XML RDB,.,,,,,., XMLDB. XMLDB, ( ) XML, XML, RDB., NeoCoreXMS 1), TX1 2), pgboscage 3)., Oracle 4), DB2 5) RDB, XML, PostgreSQL 1 XML. 6) 2.2 XML XMLDB, XML., XPath, XQuery, XSLT W3C, RDB SQL., XMLDB RDB,,., XMLDB,,. Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29 1 c 212 Information Processing Society of Japan
3. XML, DB, DB (AP). DB, DB, AP. RDB., XMLDB, XML,.,,.,, (XML / ), XML,,., AP. AP AP AP 検索キー //A=1 //A=2 //A=3 返却 XML 全体 XML 全体 XML 全体 XMLDB <root> <A>1</A> <root> <root> <B>b</B> <A>2</A> <B>b</B> <A>3</A>...... <B>b</B> </root> </root>... </root> A index 事前に作成 L1 C c1 N2 B D A d1 L2 N1 C L3 要素名等 c2 A B C D c1 d1 c2 L1 L2 L3 N1 N2 2 値 XML 値ポインタ リーフノード情報 親関係 中間ノード情報, 1 DB. XMLDB AP. AP XMLDB,, XML, AP., XMLDB,, AP, XML,. 3.1 XML,,, XML AP, XML. 2.,.,,.,,, ID( ) ID,., XML 3. Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29 1 2 c 212 Information Processing Society of Japan
<A ns= ns > <BY> <C X= x1 >c1</c> <D/> </BY> <C ns= ns1 >c2</c> </A> 1 Dell PowerEdge 19 (28 ) CPU: QuadCore Intel Xeon X5365 3.GHz 2 RAM: 16GB HDD: 1TB SATA II 72rpm 6 (RAID5) OS RedHat Linux 5 PostgreSQL 9.1.2 Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29 名前空間辞書 1 2 + + n s n s 1 6 テキストノード c 1 c 2 2 リーフノード情報 属性値 x 1 要素名辞書 1 2 3 4 4 + + ^ # + A B Y C D 中間ノード情報 3 ^3 ^1 + + + 4 + + 3 + + 2 1 2 + 3 属性名辞書 1,,,,,,,., ID, ( ), ID ( ), ( ).,,,., XML,,.,., //C/text() (XPath),. 1 + X ( 1 ) XPath,. ( 2 ),, C ID. ( 3 ), ID. ( 4 ) ( ),.,, XML, XML,.,, /A/BY/C/text() //A//BY//C/text(), XPath, (3),.,, XML DOM, XML. 4. PostgreSQL XML PostgreSQL,. 4.1, PostgreSQL 1., PostgreSQL contrib pgbench 7) XML., pgbench account, (aid int not null, bid int, abalance int, filler char(84)) 3 c 212 Information Processing Society of Japan
[sec], XML data 1, <accounts> <aid></aid> <bid></bid> <abalance></abalance> </accounts>, XML. XML, filler., PostgreSQL fillfactor 9. 1 pgbench DB 3,, XML,. 4, (sf). : pgbench(rdb ) : PostgreSQL XML : XML : XML,,,, 2, 15., TPS,.5% TPS. 4.2 DB,, DB 4. XML, XML () 4%. 1 PostgreSQL,.,, fillfactor. 72 66 6 54 48 42 36 3 24 18 12 6 2 4 6 8 1 12 14 16 [sec] 4,5 4, 3,5 3, 2,5 2, 1,5 1, 5 732 1,61 DB 作成時間 4 2,473 1,342 DB DB 作成内訳 (sf 1) 544 57 1,689 1,628 5 DB (sf 1) 他 インデクス作成 データ挿入 DB,,,,. Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29,, ( 5). XML, XML, XML, XML DOM, XPath 4 c 212 Information Processing Society of Japan
Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29 2, 1 2473., XML XML 1, 544 78%. 1342 1689 26%, XML,., XML. 45 4 35 3 トランザクション ( 更新含む ) 3 [GB] DB サイズ 25 2 25 2 15 1 5 2 4 6 8 1 12 14 16 6 DB, DB 6. XML, XML () 13%. 35%., pgbench() DB, filler., (sf) 7.,. 15 1 5 5 1 15 2 25 2 トランザクション ( 参照のみ ) 18 16 14 12 1 8 6 4 2 5 1, 1,5 2, 2,5 7 ( 6) 5 c 212 Information Processing Society of Japan
45 4 35 3 25 2 15 1 5 2 18 16 14 12 1 8 6 4 2 トランザクション ( 更新含む ) 5 1 15 2 25 3 DB サイズ [MB] トランザクション ( 参照のみ ) 5 1 15 2 25 3 DB サイズ [MB] 8 DB ( 6), (sf 1 ), XML 2TPS, 11TPS., XML () 24TPS 2 23%, 125TPS 17 2%.,, %, %.,,.,,., (sf), XML 1, XML () 11., 16., DB, 8 DB, DB 13GB., 13GB DB,., PostgreSQL, XML.,, DB,,. 5., XMLDB,,. PostgreSQL,, XML, DB 4%, 2%,. Vol.212-DPS-15 No.23 Vol.212-CSEC-56 No.23 212/2/29 1) http://www.cybertech.co.jp//db/neocorexms/ 2) http://www.toshiba-sol.co.jp/pro// 3),,, : pgboscage : PostgreSQL XMLDB, (28) 4) http://www.oracle.com/technetwork/database/features/db/index.html 5) http://www-1.ibm.com/software/data/db2// 6) http://www.postgresql.org/docs/9.1/interactive/datatype-.html 7) http://www.postgresql.org/docs/9.1/static/pgbench.html 6 c 212 Information Processing Society of Japan