Re: Calling conventions

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Calling conventions
Дата
Msg-id 4A64956002000025000289D9@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: Calling conventions  (Matthew Wakeling <matthew@flymine.org>)
Ответы Re: Calling conventions
Re: Calling conventions
Список pgsql-performance
Matthew Wakeling <matthew@flymine.org> wrote:

> On Fri, 17 Jul 2009, Kevin Grittner wrote:

>> but a factor of 100?

> The Java code runs all in RAM, versus Postgres running all from OS
> cache or Postgres shared buffer (bit  hard to tell which of those
> two it is - there is no hard drive activity anyway). The Java code
> does no page locking, whereas Postgres does loads.  The Java code is
> emulating just the index, whereas Postgres is fetching the whole row
> as well.

Oh, well, if you load all the data into Java's heap and are accessing
it through HashMap or similar, I guess a factor of 100 is about right.
I see the big difference as the fact that the Java implementation is
dealing with everything already set up in RAM, versus needing to deal
with a "disk image" format, even if it is cached.  Try serializing
those Java objects to disk and storing the file name in the HashMap,
retrieving and de-serializing the object for each reference.  Even if
it's all cached, I expect you'd be running about 100 times slower.

The Java heap isn't a very safe place to persist long-term data,
however.

-Kevin

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

Предыдущее
От: Krade
Дата:
Сообщение: Re: Full text search with ORDER BY performance issue
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Fastest char datatype