Feeds

Multivalued datatypes considered harmful

How dangerous can a data type be?

Top 5 reasons to deploy VMware with Tegile

Assuming that the PRODUCT table contains price information, try writing a query that finds the total value of each order.

One of the huge advantages of the relational model of data is that its behaviour under querying is completely predictable. Multi valued fields erode the certainty that a given query will return the canonically correct set of data as an answer.

Does the Access development team really know as little about relational database theory as this bizarre addition implies? At TechEd in Boston last month, I had a long talk with Suraj Poozhiyil, the Access Program Manager. The good news is that Suraj did, at least, convince me that the team was fully aware of the implications of introducing this new data type. So why has Microsoft done it?

According to Suraj, there were two main reasons.

The first is that Microsoft is keen for Access to be compatible with SharePoint (which already supports multi-value fields). Fine, but one has to ask whether this is for our benefit or Microsoft’s.

The second reason is that the company does seem to be genuinely interested in making the product easier for power users to drive. The development team feels that power users find the creation of many-to-many joins using three tables conceptually very difficult and will find multi-valued data types a much easier solution. Having taught Access to such users since Access 1.0 I cannot help but agree with this. Access power users will find this solution easier.

So we have a classic problem. Should we sacrifice accuracy for ease of use? Let’s reserve judgement for a moment because, in practice, we don’t have to do it in this case.

It would be possible for Microsoft to be very clever here. It could present the power user with what appears to be a multi-valued data type in the user-interface but, under the covers, it could store the data in the classic three table solution. I put this to Suraj and he agreed. “In fact”, he said “that is what we have done.”

And it is. Well, very nearly; tantalisingly nearly. But sadly, not quite. So let’s look at the precise way in which Microsoft has implemented multi-valued fields and the implications that carries for developers.

In Access 2007 users are presented with a wizard driven interface that allows them to construct and use multi-valued fields. If you were then to address the resulting database programmatically, you would see three tables. Fine so far. The really weird part is that if you actually use the GUI to look at the tables you see only one table. And if you use the query builder to create SQL to run against the single table that it sees, you find exactly the non-canonical behaviour that caused multi-valued data types to be reviled in the first place. Sigh.

Suraj tells me that ideally the development team would like the three table solution to appear in the GUI but that it won’t be possible to do this for the version currently under development (Access 2007). It may well appear in later versions.

My feeling is that this is a mistake and the ‘feature’ should either be fully implemented or not at all. However, both Suraj and I agree wholeheartedly that developers do not need to use multi-valued fields. People who understand databases already have a good way of implementing many to many relationships and will gain no benefit from multi-valued fields.

So, my clear and certain advice to developers is not to use multi-valued fields. They have nothing to offer us except potential pain.

Providing a secure and efficient Helpdesk

More from The Register

next story
Google+ goes TITSUP. But WHO knew? How long? Anyone ... Hello ...
Wobbly Gmail, Contacts, Calendar on the other hand ...
Preview redux: Microsoft ships new Windows 10 build with 7,000 changes
Latest bleeding-edge bits borrow Action Center from Windows Phone
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
Google opens Inbox – email for people too thick to handle email
Print this article out and give it to someone tech-y if you get stuck
UNIX greybeards threaten Debian fork over systemd plan
'Veteran Unix Admins' fear desktop emphasis is betraying open source
DEATH by PowerPoint: Microsoft warns of 0-day attack hidden in slides
Might put out patch in update, might chuck it out sooner
Redmond top man Satya Nadella: 'Microsoft LOVES Linux'
Open-source 'love' fairly runneth over at cloud event
prev story

Whitepapers

Cloud and hybrid-cloud data protection for VMware
Learn how quick and easy it is to configure backups and perform restores for VMware environments.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Three 1TB solid state scorchers up for grabs
Big SSDs can be expensive but think big and think free because you could be the lucky winner of one of three 1TB Samsung SSD 840 EVO drives that we’re giving away worth over £300 apiece.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.