Seq scan

Started by Diogo Biazusover 23 years ago5 messagesgeneral
Jump to latest
#1Diogo Biazus
diogo@ikono.com.br

Hi everybody.
Im trying to execute a simple UPDATE query on a table with 450000 rows
using an index in the where clause.

Example:
UPDATE table SET field = null WHERE field = 12345
( NOTICE: Field has an index )

But when I use the EXPLAIN command it always tells me that Postgres is
using Seq Scan, even if I disable Seq Scan in the postgresql.conf

The PostgreSQL is running on a Pentium III 900 Mhz, 512 MB RAM, HD SCSI
18 Gb with a RedHat Linux 7.3 installed.
Anyone can help me?
Thanks in advance,

Diogo Biazus
diogo@ikono.com.br
Ikono Sistemas & Automa��o
www.ikono.com.br

#2Jean-Luc Lachance
jllachan@nsd.ca
In reply to: Diogo Biazus (#1)
OID with %ROWTYPE in PLPGSQL

Hello all,

Is there a way to have the OID included with %ROWTYPE?
If not, can the record pointed to by a ROWTYPE record in a loop be
updated in place?
If not, can the record pointed by a cursor be updated in place?

If not can we add one of those to the list of "nice to have" for the
next version?

While I am at it, why not allow assignment of row variable from another
row variable?

Thanks

JLL

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jean-Luc Lachance (#2)
Re: OID with %ROWTYPE in PLPGSQL

Jean-Luc Lachance <jllachan@nsd.ca> writes:

Is there a way to have the OID included with %ROWTYPE?

No, because there's no guarantee that a rowtype value actually came
directly from a database row. For instance, it could be formed as
the return value of a function.

regards, tom lane

#4Jean-Luc Lachance
jllachan@nsd.ca
In reply to: Diogo Biazus (#1)
Re: OID with %ROWTYPE in PLPGSQL

Well, I found a solution for now.

I use RECORD in stead of ROWTYPE.
RECORD does hold OID if it exists.

JLL

P.S. I am still interested about updating a record in place.

Jean-Luc Lachance wrote:

Show quoted text

Hello all,

Is there a way to have the OID included with %ROWTYPE?
If not, can the record pointed to by a ROWTYPE record in a loop be
updated in place?
If not, can the record pointed by a cursor be updated in place?

If not can we add one of those to the list of "nice to have" for the
next version?

While I am at it, why not allow assignment of row variable from another
row variable?

Thanks

JLL

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

#5Jean-Luc Lachance
jllachan@nsd.ca
In reply to: Diogo Biazus (#1)
Re: OID with %ROWTYPE in PLPGSQL

I claimed victory to quickly.

PLPGSQL did compile, run and did not complain about OID but it was
always set to 0.

JLL

Jean-Luc Lachance wrote:

Show quoted text

Well, I found a solution for now.

I use RECORD in stead of ROWTYPE.
RECORD does hold OID if it exists.

JLL

P.S. I am still interested about updating a record in place.

Jean-Luc Lachance wrote:

Hello all,

Is there a way to have the OID included with %ROWTYPE?
If not, can the record pointed to by a ROWTYPE record in a loop be
updated in place?
If not, can the record pointed by a cursor be updated in place?

If not can we add one of those to the list of "nice to have" for the
next version?

While I am at it, why not allow assignment of row variable from another
row variable?

Thanks

JLL

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)