Sunday, December 5, 2010

Enterprise Database is

Using a number in a state column that corresponds to a 5 field state table, that is cross referenced to a country table that has 8 fields so that you have to 3 table joins in order to get from "20183" to "CA". Here? you want the billing address I know how to do that!

select users.FirstName || ' ' || users.LastName,
Ship.AddressLine1, Ship.AddressLine2,
Country.State, State.PostalRegion, from
users as users
join ShippingAddress as Ship on users.ID = Ship.UserID
join State as state on Ship.StateCode = state.stateID
join Country as country on state.countryId = Country.code
where users.ID = '101';

That was so easy and totally necessary. You know things are done Right when a 12-core machine takes 15 seconds to produce a page full of addresses; cause that's how long it took in 1975; when a kilobyte of memory set you back $10,000.

No comments:

Post a Comment