22 December 2010

Django Played Jazz

The PostgreSQL site has been linking to this blog a bit recently, and he's refreshing.  I'm going to spend some time looking into it.  It could be there's some intelligent life out there after all.

Here's the start of today's entry, if you didn't slide off immediately:

Don't retrieve a whole row just to get the primary key you had anyway. Don't iterate in the app; let the database server do the iteration for you.


And he signs off with this (my heart went pit-a-pat):

but far better is to make the database do all the work


It is shocking how many coders still insist on their for loops in code.  I mean, Dr. Codd made that obsolete, in the sense of providing an abstract declarative data model, in 1969/70 (the year depends on whether you were inside or outside IBM then).  In a few years, Ingress and Oracle were live.  I've concluded that MySql, PHP, java, and the web generally is what motivated the regression to COBOL/VSAM paradigms (that is, data is just a lump of bytes which can only be accessed through bespoke source code).  One didn't need to know much, and frankly most webbies didn't and don't, about data to build some snappy web site that just saves and moves gossip.  I suppose that's OK for most of the juvenilia that passes for web stuff, but not for the grown ups.

No comments: