Recent Posts
Systematic design of multi-join GROUP BY queries
Author: Alexey Makhotkin squadette@gmail.com, ~5400 words.
This is the first public revision of this text. Early readers have shared encouraging feedback, but I’m sure there’s still room for improvement. I’m releasing it now to gather broader input from a wider audience.
Update (2025-06-08): I wrote a prequel to this text: “Multi-join queries design: investigation”. https://minimalmodeling.substack.com/p/multi-join-queries-design-investigation, another 3400 words.
Problem Many times I’ve seen people asking for help with fixing some complicated SQL queries.
read more
Foreign Keys
Author: Alexey Makhotkin <squadette@gmail.com>
(Word count: 2900).
Foreign keys are one topic that you cannot ignore if you want to talk about database design. In this informational two-pager I’d like to point out the following aspects of foreign key technology:
foreign keys are only a partial solution to the problem of database consistency; in classic relational databases, eliminating foreign keys may be an easy performance win; in many real-world scenarios foreign keys could not be enforced even if the underlying database supports them; This text is a complementary chapter of “Database Design Book” https://databasedesignbook.
read more
Historized attributes: systematic table design
Author: Alexey Makhotkin squadette@gmail.com.
(Word count: 3200).
A common problem in business-oriented database design: keeping the history of values of a certain data attribute. For example, we may want to track the price of various goods, as they change with time. Many other tasks could be reduced to this problem: for example, when people change their address in the government database, we may want to keep track of previous addresses.
read more