🧭Physical Data Model
Also known as Physical Model
The data plan for one real database. It has exact column types and indexes.
Think of it like
It is like the builder's plan. It says which bricks, which pipes and how thick each wall is.
Example
The library builds Loan in PostgreSQL. Dates are DATE, IDs are BIGINT, and member ID gets an index.
Why it matters
This is the level that runs. Types, indexes and sizes set the speed and cost of every query.
Definition
Example code
sql
CREATE TABLE loan (
loan_id BIGINT PRIMARY KEY,
member_id BIGINT NOT NULL REFERENCES member,
book_id BIGINT NOT NULL REFERENCES book,
due_date DATE NOT NULL
);Common mistake
Key takeaways
- 1Exact types. Each column gets a real type.
- 2Built for speed. Indexes and partitions are chosen.
- 3Runs as code. It creates the real tables.