Re: tid scan - is it ever used? - Mailing list pgsql-general

From Jan Wieck
Subject Re: tid scan - is it ever used?
Date
Msg-id 200206031717.g53HHLs03112@saturn.janwieck.net
Whole thread Raw
In response to tid scan - is it ever used?  ("murphy pope" <pope_murphy@hotmail.com>)
List pgsql-general
murphy pope wrote:
> I realize this might be "hackers" question, but I was wondering if anyone
> has ever seen a "tid scan" in a query plan?
>
> I think a tid scan would only be used if you did something like:
>
>   select ctid from mytable;

    AFAIK  the  tidscan  is used when one specifies "WHERE ctid =
    ...".

> are there any other uses for a tid scan?

    Currently it is the fastest possible access to a single  row.
    So  an application that selects data and wants to update rows
    is optimized for PostgreSQL if it knows about that  fact  and
    qualifies the updates by ctid.

    I thought about getting ctid as a junk attribute when doing a
    SELECT ... FOR UPDATE in a cursor and using that  information
    in UPDATE ... WHERE CURRENT OF <cursorname>.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #



pgsql-general by date:

Previous
From: Curt Sampson
Date:
Subject: View vs. Statement Query Plan
Next
From: Keary Suska
Date:
Subject: Re: [PHP] Problems while compiling php_4-2.1 with PostgreSQL