Re: tid scan - is it ever used?

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: murphy pope <pope_murphy(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tid scan - is it ever used?
Date: 2002-06-03 17:17:21
Message-ID: 200206031717.g53HHLs03112@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Yahoo(dot)com #

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keary Suska 2002-06-03 17:33:05 Re: [PHP] Problems while compiling php_4-2.1 with PostgreSQL
Previous Message Nicolas Nolst 2002-06-03 16:56:59 performance issues with DBI module when data too big