[CDBI] Retrieving Columns Other then Essentials
scott.kahler at gmail.com
Fri Mar 17 17:16:35 GMT 2006
Class DBI new user here. I'm trying to follow this example from the man
You should therefore group together your columns by typical usage, as
fetching one value from a group can also pre-fetch all the others in that
group for you, for more efficient access.
So for example, if we usually fetch the artist and title, but don't
use the 'year' so much, then we could say the following:
Music::CD->columns(Primary => qw/cdid/);
Music::CD->columns(Essential => qw/artist title/);
Music::CD->columns(Others => qw/year runlength/);
Now when you fetch back a CD it will come pre-loaded with the 'cdid',
'artist' and 'title' fields. Fetching the 'year' will mean another visit to
the database, but will bring back the 'runlength' whilst it's there.
This can potentially increase performance.
My question is how exactly do I fetch the year after I've made a call such
my $cd_obj =Music::CD->retrieve(1);
I'm probably missing something very obvious but I can't seem to find it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ClassDBI