substring implementation (long string)

Поиск
Список
Период
Сортировка
От Scott Cain
Тема substring implementation (long string)
Дата
Msg-id 1059533356.1545.65.camel@localhost.localdomain
обсуждение исходный текст
Ответы Re: substring implementation (long string)  (Joe Conway <mail@joeconway.com>)
Список pgsql-general
Hello,

I am wondering about the implementation of substring for very large
strings.  I've got strings that are several million characters long and
frequently need to extract relatively small substrings (5000-40000
characters) (that's right, it's DNA).  Before I cared much about
performance, I retrieved the whole string and and substr'ed it in perl.
I realized recently it is better to do the substring in postgres
(performance increase by an order of magnitude).  So here is what I am
wondering: does postgres read the whole string into memory before it
does the substring, or does it have some sort of smart way of reading
just the substring from disk?

I am wondering because I can think of ways of potentially improving
performance, but at significant cost to the API, and I don't want to
implement it unless I will get a big boost in performance.

Thanks,
Scott

--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                         cain@cshl.org
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory


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

Предыдущее
От:
Дата:
Сообщение: Re: Does the block of code in a stored procedure execute as a transaction?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Auto-increment not really working