From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | vadim(at)krs(dot)ru (Vadim Mikheev) |
Cc: | bamby(at)marka(dot)net(dot)ua, hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] Re: [BUGS] General Bug Report: Bug in optimizer |
Date: | 1999-03-18 18:56:30 |
Message-ID: | 199903181856.NAA05806@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs pgsql-hackers |
> Agreed, this is ok as long as
>
> vac=> create table table1 (field1 int);
> CREATE
> vac=> insert into table1 values (1);
> INSERT 1583349 1
> vac=> create index i_table1__field1 on table1 (field1);
> CREATE
> vac=> explain select * from table1 where field1 = 1;
> NOTICE: QUERY PLAN:
>
> Seq Scan on table1 (cost=1.03 size=1 width=4)
>
> - SeqScan is used for small tables.
>
> So, only bug reported is left.
My guess is that the creation of the index updates the table size
statistics.
However, when I see zero size, I don't know if it is accurate, or if
someone has added rows since the last vacuum/index creation, so I think
it is correct to use an index on a zero-length table if it is
appropriate. If the size is 1, I will assume that number is accurate,
and do a sequential scan.
Does that make sense?
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Vadim Mikheev | 1999-03-18 18:56:32 | Re: [HACKERS] Re: [BUGS] General Bug Report: Bug in optimizer |
Previous Message | Bruce Momjian | 1999-03-18 18:53:38 | Re: [HACKERS] Re: [BUGS] General Bug Report: Bug in optimizer |
From | Date | Subject | |
---|---|---|---|
Next Message | Vadim Mikheev | 1999-03-18 18:56:32 | Re: [HACKERS] Re: [BUGS] General Bug Report: Bug in optimizer |
Previous Message | Bruce Momjian | 1999-03-18 18:53:38 | Re: [HACKERS] Re: [BUGS] General Bug Report: Bug in optimizer |