One-to-one
One row pairs with exactly one other row. Ideal for optional or sensitive details.
profile.user_id → user.user_id
Open to thoughtful data problems
I turn complicated data into structures people can trust, queries that move quickly, and answers that are easy to understand.
SELECT clarity, consistency, speed FROM data;
Query complete
01 / Data modeling
A good schema says what belongs together, what repeats, and where the truth lives.
One row pairs with exactly one other row. Ideal for optional or sensitive details.
profile.user_id → user.user_id
One parent owns many children; each child points back to one parent.
orders.customer_id → customer.customer_id
Both sides can repeat. A junction table turns the relationship into two clean one-to-many links.
PRIMARY KEY (author_id, book_id)
One shared concept connects to multiple entity types through an ID and a type discriminator.
(taggable_type, taggable_id)
A central fact table stores measurable events. Small dimension tables add the who, what, and when for fast, understandable reporting.
SUM(fact_sales.amount) BY dimensions
02 / Performance
Speed comes from reducing the data read, the operations performed, and the work repeated.
Give frequent lookups a shorter path to the rows they need.
Target selective filters, joins, and sorts. Cover important queries, then remove redundant indexes that slow writes.
INDEX (customer_id, ordered_at)
Split very large tables into manageable pieces with a useful boundary.
Date-based partitions can reduce scanned data, simplify archival, and make maintenance predictable.
PARTITION BY RANGE (sale_date)
Make the efficient route possible before adding more hardware.
Read execution plans, keep predicates searchable, return only needed columns, and avoid repeated work.
EXPLAIN / actual plan
03 / Profile
I care about the full path from raw records to a trusted answer: sound structure, explicit business rules, readable SQL, and reporting that respects the person using it.
View my Gitea