[CDBI] Re: Many-to-Many - why no CDBI::Relationship?

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Wed Aug 23 01:19:57 BST 2006


Ryan Tate asked:
> I'm curious if you have any sense how this performs this under load. I
> want to go beyond CDBI's native many-to-many support because it
> requires an extra db query for each and every associated item you want
> to flesh out, as oppposed to one query for all items. But maybe these
> simple SQL queries aren't much of a load?

My feeling is that they aren't, but I've done no real benchmarking, under
load or otherwise. My applications just don't feel slow to me, so I've felt
no need to optimize this aspect. I suspect that other aspects (like network
I/O, HTML rendering time in the web browser, Perl object creation, etc.)
dominate the user experience. My CDBI classes and inter-class relationships
are not super-complicated though, and I'm not typically instantiating a ton
of objects usually. YMMV.

I can certainly think of occasions when I don't need to flesh out the related
objects because they are simply not utilized, so doing a join in those cases
seems superfluous.

> In my own benchmarks with my particular rdbms (the usual one, say what
> you will of it), a join always wins out over many simple connects.

I think that will vary depending on the RDBMS being used and the table schema
and size and indexing methodology, of course. I've certainly used a couple of
RDBMSes over the years which have had rather atrocious join performance under
any kind of load greater than zero, but perhaps that was only true back in
the Mesozoic Era and all modern RDBMS's have really good join performance
now.



More information about the ClassDBI mailing list