R-tree๋ ์ผ๋ฐ์ ์ผ๋ก ํธ๋ฆฌ ๋
ธ๋์ ํฌ๊ธฐ๋ฅผ ๋์คํฌ ํ์ด์ง์ ํฌ๊ธฐ์ ๊ฐ๊ฒ ํจ์ผ๋ก์จ I/O ์ฑ๋ฅ์ด ์ต์ ํ ๋๋๋ก ๊ตฌํํ๋ค. ์ต๊ทผ์๋ ์ฃผ๋ฉ๋ชจ๋ฆฌ ํ๊ฒฝ์์ CPU ์บ์ ์ฑ๋ฅ์ ์ต์ ํํ๋ R-tree์ ๋ณํ์ด ๊ฐ๋ฐ๋์๋ค. ์ด๋ ๋
ธ๋์ ํฌ๊ธฐ๋ฅผ ์บ์ ๋ผ์ธ ํฌ๊ธฐ์ ์ ๋ฐฐ๋ก ํ๊ณ MBR์ ์ ์ฅ๋๋ ํค๋ฅผ ์์ถํ์ฌ ๋
ธ๋ ํ๋์ ๋ ๋ง์ ์ํธ๋ฆฌ๋ฅผ ์ ์ฅํจ์ผ๋ก์จ ์ฑ๋ฅ์ ๋์๋ค. ๊ทธ๋ฌ๋, ๋์คํฌ ์ต์ R-tree์ ์บ์ ์ต์ R-tree์ ๋
ธ๋ ํฌ๊ธฐ ์ฌ์ด์๋ ์์ญ-์๋ฐฑ ๋ฐ์ดํธ์ ์-์์ญ ํฌ๋ก๋ฐ์ดํธ๋ผ๋ ํฐ ์ฐจ์ด๊ฐ ์์ผ๋ฏ๋ก, I/O ์ต์ R-tree๋ ์บ์ ์ฑ๋ฅ์ด ๋์๊ณ ์บ์ ์ต์ R-tree๋ ๋์คํฌ I/O ์ฑ๋ฅ์ด ๋์ ๋ฌธ์ ์ ์ ๊ฐ์ง๊ณ ์๋ค. ์ด ๋
ผ๋ฌธ์์๋ CPU ์บ์์ ๋์คํฌ I/O์ ๋ชจ๋ ์ต์ ์ธ R-tree, PR-tree๋ฅผ ์ ์ํ๋ค. ์บ์ ์ฑ๋ฅ์ ์ํด PR-tree ๋
ธ๋์ ํฌ๊ธฐ๋ฅผ ์บ์ ๋ผ์ธ ํฌ๊ธฐ๋ณด๋ค ํฌ๊ฒ ๋ง๋ ๋ค์ CPU์ ์ ๋ฐ์
(prefetch) ๋ช
๋ น์ด๋ฅผ ์ด์ฉํ์ฌ ์บ์ ์คํจ ํ์๋ฅผ ์ค์ด๊ณ , ํธ๋ฆฌ ๋
ธ๋๋ฅผ ๋์คํฌ ํ์ด์ง์ ๋ญ๋น๊ฐ ์ ๋๋ก ๋ฐฐ์นํจ์ผ๋ก์จ ๋์คํฌ I/O ์ฑ๋ฅ๋ ํฅ์์ํจ๋ค. ๋ํ, ์ด ๋
ผ๋ฌธ์์๋ PR-tree์์ ๊ฒ์ ์ฐ์ฐ์ ์ํํ๋๋ฐ ๋๋ ์บ์ ์คํจ ๋น์ฉ์ ๊ณ์ฐํ๋ ๋ถ์ ๋ฐฉ๋ฒ์ ์ ์ํ๊ณ , ์ต์ ์ ์บ์์ I/O ์ฑ๋ฅ์ ๋ณด์ด๋ PR-tree๋ฅผ ๊ตฌ์ฑํ๊ธฐ ์ํด, ๊ฐ๋ฅํ ํฌ๊ธฐ์ ๋ด๋ถ ๋จ๋ง ๋
ธ๋, ์ค๊ฐ ๋
ธ๋๋ฅผ ๊ฐ๋ PR-tree ์์ฑํ์ฌ ์ฑ๋ฅ์ ๋น๊ตํ์๋ค. PR-tree๋ ๋์คํฌ ์ต์ R-tree๋ณด๋ค ์ฝ์
์ฐ์ฐ์ 3.5์์ 15.1๋ฐฐ, ์ญ์ ์ฐ์ฐ์ 6.5์์ 15.1๋ฐฐ, ๋ฒ์ ์ง์๋ 1.3์์ 1.9๋ฐฐ, k-์ต๊ทผ์ ์ง์๋ 2.7์์ 9.7๋ฐฐ์ ์บ์ ์ฑ๋ฅ ํฅ์์ด ์์๋ค. ๋ชจ๋ ์คํ์์ ๋งค์ฐ ์์ I/O ์ฑ๋ฅ ์ ํ๋ง์ ๋ณด์๋ค. R-trees have been traditionally optimized for the I/O performance with the disk page as the tree node. Recently, researchers have proposed cache-conscious variations of R-trees optimized for the CPU cache performance in main memory environments, where the node size is several cache lines wide and more entries are packed in a node by compressing MBR keys. However, because there is a big difference between the node sizes of two types of R-trees, disk-optimized R-trees show poor cache performance while cache-optimized R-trees exhibit poor disk performance. In this paper, we propose a cache and disk optimized R-tree, called the PR-tree (Prefetching R-tree). For the cache performance, the node size of the PR-tree is wider than a cache line, and the prefetch instruction is used to reduce the number of cache misses. For the I/O performance, the nodes of the PR-tree are fitted into one disk page. We represent the detailed analysis of cache misses for range queries, and enumerate all the reasonable in-page leaf and nonleaf node sizes, and heights of in-page trees to figure out tree parameters for best cache and I/O performance. The PR-tree that we propose achieves better cache performance than the disk-optimized R-tree: a factor of 3.5-15.1 improvement for one-by-one insertions, 6.5-15.1 improvement for deletions, 1.3-1.9 improvement for range queries, and 2.7-9.7 improvement for k-nearest neighbor queries. All experimental results do not show notable declines of the I/O performance.