Efficiency vs. code bloat for SELECT wrappers

Поиск
Список
Период
Сортировка
От Colin Wetherbee
Тема Efficiency vs. code bloat for SELECT wrappers
Дата
Msg-id 4765B56C.3040801@denterprises.org
обсуждение исходный текст
Ответы Re: Efficiency vs. code bloat for SELECT wrappers  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Greetings.

I am working on a PostgreSQL-backed mod_perl web application that's just
in its infancy.

Let's say I have a users table that holds about 15 columns of data about
each user.

If I write one Perl sub for each operation on the table (e.g. one that
gets the username and password hash, another that gets the last name and
first name, etc.), there will be a whole lot of subs, each of which
performs one very specific task.

If I write one larger Perl sub that grabs the whole row, and then I deal
with the contents of the row in Perl, ignoring columns as I please, it
will require fewer subs and, in turn, imply cleaner code.

My concern is that I don't know what efficiency I would be forfeiting on
the PostgreSQL side of the application by always querying entire rows if
my transaction occurs entirely within a single table.  Of course, I
would want to handle more complicated JOINs and other more intensive
operations on the PostgreSQL side.

I don't think the application will ever store a tuple larger than about
512 bytes in any table, so the network speed wouldn't really come into play.

Thanks.

Colin

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Recovering data via raw table and field separators
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Efficiency vs. code bloat for SELECT wrappers