Skip to Content
Javaパフォーマンス第2版
book

Javaパフォーマンス第2版

by Scott Oaks
March 2025
Intermediate to advanced
450 pages
7h 10m
Japanese
O'Reilly Media, Inc.
Content preview from Javaパフォーマンス第2版

第11章 データベースパフォーマンスのベストプラクティス データベースパフォーマンスのベストプラクティス

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

この章では、Java駆動のデータベース・アプリケーションのパフォーマンスを調査する。 データベースにアクセスするアプリケーションは、Java以外のパフォーマンス問題の影響を受ける。データベースがI/Oバウンドしていたり、インデックスが欠落しているためにフル・テーブル・スキャンを必要とするSQLクエリを実行している場合、Javaのチューニングやアプリケーション・コーディングをいくら行っても、パフォーマンス問題を解決することはできない。データベース技術を扱うときは、データベースのチューニングやプログラミングの方法について(別のソースから)学ぶ準備をしておくこと。

これは、データベースを使用するアプリケーションのパフォーマンスが、JVMや使用されているJavaテクノロジーの制御下にあるものに対して無頓着であると言っているのではない。むしろ、良好なパフォーマンスを得るためには、データベースとアプリケーションの両方が正しくチューニングされ、可能な限り最良のコードを実行していることを確認する必要がある。

この章ではまずJDBCドライバから見ていく。JDBCドライバはリレーショナルデータベースとやり取りするデータフレームワークに影響を与えるからだ。JPAやSpringデータモジュールを含め、多くのフレームワークがJDBCの詳細を抽象化している。

サンプルデータベース

この章の例では、256銘柄のデータを1年間ストアするサンプルデータベースを使用する。1年は261営業日である。

個々の銘柄の株価は、STOCKPRICEというテーブルに格納されている。STOCKPRICEは、銘柄シンボルと日付を主キーとしている。このテーブルには66,816行(256×261)がある。

STOCKOPTIONPRICE テーブルは、シンボル、日付、オプション番号を表す整数を主キーとするデータを保持している。このテーブルには 334,080 行(256 × 261 × 5)がある。

ジェイデービーシー

この章では、JPAバージョン2.xの観点からデータベースのパフォーマンスについて説明する。しかし、JPAはJDBCを使用しており、多くの開発者はいまだにJDBC ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

スクラム実践者が知るべき97のこと

スクラム実践者が知るべき97のこと

Gunther Verheyen, 吉羽 龍太郎, 原田 騎郎, 永瀬 美穂

Publisher Resources

ISBN: 9798341626010