Krace, the parent comes first. This is required because of the way SQL multi-column indexing works: a two-column index is the first column index + a sub-index. The first index (the parent_id) is used to find all children of the parent. The second is used to find a specific item.

If you reverse the order, the database has to maintain separate indexes for the parent column foreign key and for the dual-index key, so database *write operations* get slower.