Re: Postgres + Xapian (was Re: fulltext searching via a custom index type )

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Postgres + Xapian (was Re: fulltext searching via a custom index type )
Дата
Msg-id 20040102215429.GA507@dcc.uchile.cl
обсуждение исходный текст
Ответ на Postgres + Xapian (was Re: fulltext searching via a custom index type )  (Eric B.Ridge <ebr@tcdi.com>)
Ответы Re: Postgres + Xapian (was Re: fulltext searching via a  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: Postgres + Xapian (was Re: fulltext searching via a custom index type )  (Eric Ridge <ebr@tcdi.com>)
Список pgsql-hackers
On Thu, Jan 01, 2004 at 11:19:07PM -0500, Eric B.Ridge wrote:

> I couldn't think of a way to create a whole new database type for 
> Xapian that could deal with managing 5 btree indexes inside of Postgres 
> (other than using tables w/ standard postgres btree index on certain 
> fields), so instead, I dug into Xapian and abstracted out it's 
> filesystem i/o (open, read, write, etc).
> 
> (as an aside, I did spend some time pondering ways to adapt Postgres' 
> nbtree AM to handle this, but I just don't understand how it works)

I think your approach is too ugly.  You will have tons of problems the
minute you start thinking about concurrency (unless you want to allow
only a single user accessing the index) and recovery (unless you want to
force users to REINDEX when the system crashes).

I think one way of attacking the problem would be using the existing
nbtree by allowing it to store the five btrees.  First read the README
in the nbtree dir, and then poke at the metapage's only structure.  You
will see that it has a BlockNumber to the root page of the index.  Try
modifying that to make it have a BlockNumber to every index's root page.
You will have to provide ways to access each root page and maybe other
nonstandard things (such as telling the root split operation what root
page are you going to split), but you will get recovery and concurrency
(at least to a point) for free.

Hope this helps,

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La espina, desde que nace, ya pincha" (Proverbio africano)


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: cache in plpgsql
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: [JDBC] PL/Java issues