Re: [Q] optmizing postgres for 'single client' / many small queries - Mailing list pgsql-general

From David Fetter
Subject Re: [Q] optmizing postgres for 'single client' / many small queries
Date
Msg-id 20090903162807.GR8410@fetter.org
Whole thread Raw
In response to Re: [Q] optmizing postgres for 'single client' / many small queries  (Richard Broersma <richard.broersma@gmail.com>)
List pgsql-general
On Thu, Sep 03, 2009 at 07:24:50AM -0700, Richard Broersma wrote:
> On Wed, Sep 2, 2009 at 4:35 PM, David Fetter<david@fetter.org> wrote:
>
> > Hibernate has the very nice feature of being able to get out of
> > your way.  Properly used, it can keep completely out of the
> > business of making (wrong) guesses based on DDL, which is what
> > ORMs often do.  DBIx::Class
> > <http://search.cpan.org/dist/DBIx-Class/> has gone a long way in
> > the right direction.
> >
> > Ones which (attempt to) dictate decisions about DDL are just off
> > the map. :P
>
> David, do you know how well these kinds of ORMs work when it come to
> mapping  non-trivial schema designs?  For example, how would these
> work when creating a mapping for the multiple inheritance design
> that you've blogged about earlier?

If your mapper only does the job of mapping, you can choose
classes/objects and then map them to the appropriate, possibly
parameterized, SQL queries, which the DB people can then freely
rearrange.

One nice feature of such a system is that the DBA and/or DB developer
has a way to know what the client code expects.  In OO terms, there
are public interfaces--everything mentioned in the ORM layer--and
private interfaces--DDL, DML, and DCL--to the database.

Programmers who like to use object-oriented languages and methods
should be happy about this object-oriented approach to database
management, but for some reason, a lot of them don't understand that
the idea of public and private interfaces applies to what they (too
simplistically, much of the time) think of as "the persistence layer."

Cheers,
David.
--
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: auto-increment in a view
Next
From: Christopher Browne
Date:
Subject: Re: handle audiofiles in postgres