<< Chapter < Page
  Hệ quản trị cơ sở dữ liệu     Page 12 / 26
Chapter >> Page >

Cách tiếp cận đơn giản này, để thực hiện CSDL quan hệ, không còn phù hợp khi kích cỡ của CSDL tăng lên. Ta sẽ thấy những điểm lợi về mặt hiệu năng từ việc gán một cách thận trọng các mẩu tin với các khối, và từ việc tổ chức kỹ lưỡng chính bản thân các khối. Như vậy, có vẻ như là một cấu trúc file phức tạp hơn lại có lợi hơn, ngay cả trong trường hợp ta giữ nguyên chiến lược lưu trữ mỗi quan hệ trong một file riêng biệt.

Tuy nhiên, nhiều hệ CSDL quy mô lớn không nhờ cậy trực tiếp vào hệ điều hành nền để quản trị file. Thay vào đó, một file hệ điều hành được cấp phát cho hệ CSDL. Tất cả các quan hệ được lưu trữ trong một file này, và sự quản trị file này thuộc về hệ CSDL. Để thấy những điểm lợi của việc lưu trữ nhiều quan hệ trong cùng một file, ta xét vấn tin SQL sau:

SELECT account_number, customer_number, customer_treet, customer_city

FROM depositor, customer

WHEREdepositor.customer_name = customer.customername;

Câu vấn tin này tính một phép nối của các quan hệ depositor và customer. Như vậy, đối với mỗi bộ của depositor, hệ thống phải tìm bộ của customer có cùng giá trị customer_name. Một cách lý tưởng là việc tìm kiếm các mẩu tin này nhờ sự trợ giúp của chỉ mục. Bỏ qua việc tìm kiếm các mẩu tin như thế nào, ta chú ý vào việc truyền từ đĩa vào bộ nhớ. Trong trường hợp xấu nhất, mỗi mẩu tin ở trong một khối khác nhau, điều này buộc ta phải đọc một khối cho một mẩu tin được yêu cầu bởi câu vấn tin. Ta sẽ trình bày một cấu trúc file được thiết kế để thực hiện hiệu quả các câu vấn tin liên quan đến depositor customer. Các bộ depositor đối với mỗi customer_name được lưu trữ gần bộ customer có cùng customer_name. Cấu trúc này trộn các bộ của hai quan hệ với nhau, nhưng cho phép xử lý hiệu quả phép nối. Khi một bộ của của quan hệ customer được đọc, toàn bộ khối chứa bộ này được đọc từ đĩa vào trong bộ nhớ chính. Do các bộ tương ứng của depositor được lưu trữ trên đĩa gần bộ customer, khối chứa bộ customer chứa các bộ của quan hệ depositor cần cho xử lý câu vấn tin. Nếu một customer có nhiều account đến nỗi các mẩu tin depositor không lấp đầy trong một khối, các mẩu tin còn lại xuất hiện trong khối kế cận. Cấu trúc file này, được gọi là gom cụm (clustering), cho phép ta đọc nhiều mẩu tin được yêu cầu chỉ sử dụng một đọc khối, như vậy ta có thể xử lý câu vấn tin đặc biệt này hiệu quả hơn.

Tuy nhiên, cấu trúc gom cụm trên lại tỏ ra không có lợi bằng tổ chức lưu mỗi quan hệ trong một file riêng, đối với một số câu vấn tin, chẳng hạn:

SELECT *

FROM customer

Việc xác định khi nào thì gom cụm thường phụ thuộc vào kiểu câu vấn tin mà người thiết kế CSDL nghĩ rằng nó xẩy ra thường xuyên nhất. Sử dụng thận trọng gom cụm có thể cải thiện hiệu năng đáng kể trong việc xử lý câu vấn tin.

Lưu trữ tự điển dữ liệu

Một hệ CSDL cần thiết duy trì dữ liệu về các quan hệ, như sơ đồ của các quan hệ. Thông tin này được gọi là tự điển dữ liệu (data dictionary) hay mục lục hệ thống (system catalog). Trong các kiểu thông tin mà hệ thống phải lưu trữ là:

  • Các tên của các quan hệ
  • Các tên của các thuộc tính của mỗi quan hệ

Questions & Answers

it is the relatively stable flow of income
Chidubem Reply
what is circular flow of income
Divine Reply
branches of macroeconomics
SHEDRACK Reply
what is Flexible exchang rate?
poudel Reply
is gdp a reliable measurement of wealth
Atega Reply
introduction to econometrics
Husseini Reply
Hi
mostafa
hi
LEMLEM
hello
Sammol
hi
Mahesh
bi
Ruqayat
hi
Ruqayat
Hi fellas
Nyawa
hey
Sammol
hi
God
hello
Jahara
Good morning
Jorge
hi
abubakar
hi
Nmesoma
hi
Mahesh
Hi
Tom
Why is unemployment rate never zero at full employment?
Priyanka Reply
bcoz of existence of frictional unemployment in our economy.
Umashankar
what is flexible exchang rate?
poudel
due to existence of the pple with disabilities
Abdulraufu
the demand of a good rises, causing the demand for another good to fall
Rushawn Reply
is it possible to leave every good at the same level
Joseph
I don't think so. because check it, if the demand for chicken increases, people will no longer consume fish like they used to causing a fall in the demand for fish
Anuolu
is not really possible to let the value of a goods to be same at the same time.....
Salome
Suppose the inflation rate is 6%, does it mean that all the goods you purchase will cost 6% more than previous year? Provide with reasoning.
Geetha Reply
Not necessarily. To measure the inflation rate economists normally use an averaged price index of a basket of certain goods. So if you purchase goods included in the basket, you will notice that you pay 6% more, otherwise not necessarily.
Waeth
discus major problems of macroeconomics
Alii Reply
what is the problem of macroeconomics
Yoal
Economic growth Stable prices and low unemployment
Ephraim
explain inflationcause and itis degre
Miresa Reply
what is inflation
Getu
increase in general price levels
WEETO
Good day How do I calculate this question: C= 100+5yd G= 2000 T= 2000 I(planned)=200. Suppose the actual output is 3000. What is the level of planned expenditures at this level of output?
Chisomo Reply
how to calculate actual output?
Chisomo
how to calculate the equilibrium income
Beshir
Criteria for determining money supply
Thapase Reply
who we can define macroeconomics in one line
Muhammad
Aggregate demand
Mohammed
C=k100 +9y and i=k50.calculate the equilibrium level of output
Mercy Reply
Hi
Isiaka
Hi
Geli
hy
Man
👋
Bahunda
hy how are you?
Man
ys
Amisha
how are you guys
Sekou
f9 guys
Amisha
how are you guys
Sekou
ys am also fine
Amisha
fine and you guys
Geli
from Nepal
Amisha
nawalparasi district from belatari
Amisha
nd u
Amisha
I am Camara from Guinea west Africa... happy to meet you guys here
Sekou
ma management ho
Amisha
ahile becheclor ho
Amisha
hjr ktm bta ho ani k kaam grnu hunxa tw
Amisha
belatari
Amisha
1st year ho
Amisha
nd u
Amisha
ahh
Amisha
kaha biratnagar
Amisha
ys
Amisha
kina k vo
Amisha
money as unit of account means what?
Kalombe
A unit of account is something that can be used to value goods and services and make calculations
Jim
all of you please speak in English I can't understand you're language
Muhammad
I want to know how can we define macroeconomics in one line
Muhammad
it must be .9 or 0.9 no Mpc is greater than 1 Y=100+.9Y+50 Y-.9Y=150 0.1Y/0.1=150/0.1 Y=1500
Kalombe
Mercy is it clear?😋
Kalombe
hi can someone help me on this question If a negative shocks shifts the IS curve to the left, what type of policy do you suggest so as to stabilize the level of output? discuss your answer using appropriate graph.
Galge Reply
if interest rate is increased this will will reduce the level of income shifting the curve to the left ◀️
Kalombe
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Hệ quản trị cơ sở dữ liệu. OpenStax CNX. Jul 31, 2009 Download for free at http://cnx.org/content/col10838/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Hệ quản trị cơ sở dữ liệu' conversation and receive update notifications?

Ask