Re: Doubt in IndexScanDescData

Поиск
Список
Период
Сортировка
Искать
От
Hans-Juergen Schoenig
Тема
Re: Doubt in IndexScanDescData
Дата
Msg-id
8352221D-AE86-4D66-B8D0-9CC3574F26D2@cybertec.at
Ответ на
Список
Дерево обсуждения
Doubt in IndexScanDescData Suresh <suiyengar@yahoo.com>
Re: Doubt in IndexScanDescData Hans-Juergen Schoenig <postgres@cybertec.at>
Re: Doubt in IndexScanDescData Suresh <suiyengar@yahoo.com>
Re: Doubt in IndexScanDescData Hans-Juergen Schoenig <postgres@cybertec.at>
Doubt in heap_release_fetch Suresh <suiyengar@yahoo.com>
Re: Doubt in heap_release_fetch Tom Lane <tgl@sss.pgh.pa.us>
Doubt in index scan code Suresh <suiyengar@yahoo.com>
Re: Doubt in index scan code Dave Cramer <pg@fastcrypt.com>
Stack depth exceeded error Suresh <suiyengar@yahoo.com>
Re: Stack depth exceeded error Gregory Stark <stark@enterprisedb.com>
Checking stack depth Suresh <suiyengar@yahoo.com>
Re: Checking stack depth Tom Lane <tgl@sss.pgh.pa.us>
Re: Stack depth exceeded error Suresh <suiyengar@yahoo.com>
Re: Doubt in IndexScanDescData Gregory Stark <stark@enterprisedb.com>
segfault in locking code Suresh <suiyengar@yahoo.com>
Re: segfault in locking code Tom Lane <tgl@sss.pgh.pa.us>
Doubt in index subplan query Suresh <suiyengar@yahoo.com>
Re: Doubt in index subplan query Decibel! <decibel@decibel.org>
Getting statistics Suresh <suiyengar@yahoo.com>

this might clear up the problem.
here is an example making clear what happens:

select phone_number from phonebook where name = 'xy';

index is asked to find the right place in the heap to retrieve the data.
this is what happens during an index scan.
i suggest to step tnrough this process with a debugger to see what is going on.

hans



On Feb 17, 2008, at 5:13 PM, Suresh wrote:

Hans-Juergen Schoenig <postgres@cybertec.at> wrote:

On Feb 17, 2008, at 4:33 PM, Suresh wrote:

[ "include/access/relscan.h" ]

In  IndexScanDescData,  whats the purpose of having two Relation variables.

typedef struct IndexScanDescData
{
        Relation        heapRelation;   /* heap relation descriptor, or NULL */
        Relation        indexRelation;  /* index relation descriptor */
....
...
}IndexScanDescData;


The index does not contain the entire tuple. If you index column A the index will not contain values in column B of the same table.
Thus, if you find a record in the index one of the things which have to be done is to get the record from disk to check visibility and other columns.

Yes thats correct. But I still dont get it. To get record from the disk on match, we need Relation data. But whats the purpose having two seperate Relation variables ?

Does it mean that heaprelation will contain only info about that particular column of the table and index relation will have info about the whole tuple of the relation ?


best regards,
hans-juergen schoenig



--
Cybertec Schönig & Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, 2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql.at, www.cybertec.at





Never miss a thing. Make Yahoo your homepage.



--
Cybertec Schönig & Schönig GmbH
PostgreSQL Solutions and Support
Gröhrmühlgasse 26, 2700 Wiener Neustadt
Tel: +43/1/205 10 35 / 340
www.postgresql.at, www.cybertec.at


В списке pgsql-hackers по дате отправления
От: Suresh
Дата:
Сообщение: Re: Doubt in IndexScanDescData
От: Gregory Stark
Дата:
Сообщение: Re: Doubt in IndexScanDescData
FAQ