I've always been told that, when laying out database tables, the columns that are keys should be at the top of the column list in order to speed up processing. In other words, if we have a table of customer addresses, and it's linked to a customer table by some column called "CUSTID", then the "CUSTID" column should be first up and all the address columns should come after.
eg:
CUSTID
ADDR1
ADDR2
.
.
SHIPPING ADDR1
SHIPPING ADDR2
.
.
BILLING ADDR1
BILLING ADDR1
.
.
and so on.
I guess the idea is that, when performing a query, the engine doesn't have to wade through a lot of data to find the keys required for the query.
I've been wondering if it's possible to implement this in SS. I've tried putting the $db array AFTER the $has_one array in the DataObject definition but I still wind up with the contents of the $has_one array after the $db. Short of hacking the core code, is there any way of setting the order of table columns?
Just wonderin', is all... :)