Sequencial scan over primary keys 2 
Author Message
 Sequencial scan over primary keys 2

Just another question : Does foreign has a automatic created index, like
primary keys?
Quote:
----- Original Message -----



Sent: Sexta-feira, 10 de Novembro de 2000 10:16
Subject: [GENERAL] Sequencial scan over primary keys

:
: Hello,
:
:     I need help in case below. My table tipo_categoria has a primary key,
: called cod_categoria When I use this key as parameter for my sql script,
the
: result of execution is a sequencial scan, but this is a PRIMARY KEY, it
does
: has an index. How can it be explained?
:
:
:
: sitest=# CREATE TABLE tipo_categoria (
: sitest(#        cod_categoria        smallint NOT NULL,
: sitest(#        descricao            varchar(40),
: sitest(#        CONSTRAINT XPKtipo_categoria PRIMARY KEY (cod_categoria)
: sitest(#
: sitest(# );
: NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index
: 'xpktipo_categoria' for table 'tipo_categoria'
: CREATE
: sitest=# copy tipo_categoria from '/home/postgres/categ.txt';
: COPY
: sitest=# explain select * from tipo_categoria where cod_categoria = 1;
: NOTICE:  QUERY PLAN:
:
: Seq Scan on tipo_categoria  (cost=0.00..22.50 rows=10 width=14)
:
: EXPLAIN
: sitest=# \di
:            List of relations
:         Name        | Type  |  Owner
: --------------------+-------+----------
: ...
:  xpktipo_categoria  | index | postgres
: ...
: (26 rows)
: sitest=# select * from tipo_categoria;
:  cod_categoria |               descricao
: ---------------+---------------------------------------
:              0 | Categoria chamador desconhecida
:              1 | Reserva
:              2 | Reserva
: ..
:            224 | Assinante com tarifacao especial
:            226 | Telefone publico interurbano
: (20 rows)
:
:
: Thanks.
:
: Jos Vilson de Mello de Farias
: Digitro Tecnologia Ltda - Brasil
:



Tue, 29 Apr 2003 20:45:48 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Sequencial scan over primary keys

2. No Luck -> Re: [GENERAL] Sequencial scan over primary keys

3. sequencial scans

4. Query for sequencial scan

5. DB2 UDB V7.1 primary key constraint and allow reverse scans

6. using big primary keys v/s small primary keys

7. Primary key or no primary key

8. Composite Primary key or 1 primary key column with all values

9. Diff between Primary key and non primary key select

10. Primary Key / Working Code to get primary key of a table using ADO and schemas

11. Numeric Primary Key vs. Combination Primary Key


 
Powered by phpBB® Forum Software