Databasen - Revisited
msergeant at messagelabs.com
Wed Oct 18 19:20:35 BST 2006
On 18-Oct-06, at 1:08 PM, Peter Corlett wrote:
> On Wed, Oct 18, 2006 at 12:16:00PM -0400, Matt Sergeant wrote:
>> There are lots of fairly obvious right answers (localisation would
>> be one
>> obvious one), but most people won't get the fact that the primary key
>> index is a bad thing, because the entire table fits into a single
>> page of
>> pretty much every DB I know, so index access is actually slower
>> than a
>> full table scan.
> I think I'd be wary of working for somebody who insisted this was
> better and considered this sort of hack a virtue.
Sorry, but when it comes down to performance, squeezing out every
last drop is not a hack. Do you consider a schwarzian transform a
> Any RDBMS worth its salt will skip the index if it's clearly faster
> to do a
> full table scan.
You prefer to force the optimiser to have to examine its choices than
give it none? There's a reason databases provide extended syntaxes to
ignore the optimiser choices and force use of an index - optimisers
aren't that smart. (and yes, this is another one of the reasons why I
think ORMs are bad).
It was a very specific example to try and get at very specific
knowledge (fitting a table into a page). If you can think of a better
way to get at that knowledge please let me know.
> So all you've actually achieved is a less robust schema
> which may, ironically, cause the optimiser to make poorer decisions.
Please state when this would happen unless it's just postulating.
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
More information about the london.pm