Re: Proposal: Create index on foreign table - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: Proposal: Create index on foreign table
Date
Msg-id 4F66C549.10706@lab.ntt.co.jp
Whole thread Raw
In response to Re: Proposal: Create index on foreign table  (Shigeru Hanada <shigeru.hanada@gmail.com>)
List pgsql-hackers
(2012/03/16 22:51), Shigeru Hanada wrote:
> 2012/3/16 Etsuro Fujita<fujita.etsuro@lab.ntt.co.jp>:

>> The index creation is supported for a flat file such as CSV and a remote
>> table on a RDB e.g., Postgres using CREATE INDEX.

> IMHO CREATE INDEX for foreign tables should have general design,
> not specific to some kind of FDWs.

OK.  I'll try to design CREATE INDEX more generally, though I'll at 
first focus on those two.

>> I'd like to build the index physical data file for a flat file using the
>> index access method of regular tables (ie btree, hash, gin, gist, and
>> spgist) based on the following transformation between the TID and the
>> file offset to some data in the file:
>>
>>     block_number  = file_offset_to_some_data / BLCKSZ
>>     offset_number = file_offset_to_some_data % BLCKSZ
>
> Indeed these information would help searching data stored in local
> files.  But, again, it seems too specific to file-based FDWs.  I'd
> suggest separating basic general design and implementation by FDWs.
> The design you shown here seems indexed-file_fdw to me...

This transformation is for a flat file.  I think an FDW author who wants 
to build the index physical data file for an external data may choose 
any transformation that defines a one-to-one mapping into the TID space.

Best regards,
Etsuro Fujita


pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: Why does exprCollation reject List node?
Next
From: Etsuro Fujita
Date:
Subject: Re: Proposal: Create index on foreign table