In response to [EMAIL PROTECTED]:
> > The standard question: when was the last time you did a vacuum analyze
> > on this table?
>
> Never did.
That's your problem. Without updated statistics on that table, PostgreSQL
probably thinks that it's so small that an index scan wouldn't be any
faster.
ществует
psql:../../pg_dumpnew:9213660: ERROR: нет доступа к файлу "$libdir/dbsize":
No
such file or directory
psql:../../pg_dumpnew:9213663: ERROR: функция
public.pg_tablespace_size(oid) не
существует
psql:../../pg_dumpnew:9213671: ERROR: нет доступа к файлу "$libdir/dbsize"
On 2008-03-26 09:41, [EMAIL PROTECTED] wrote:
> 5. explain select count(*) from akh_testing_result
> Aggregate (cost=206372.95..206372.95 rows=1 width=0)
> -> Seq Scan on akh_testing_result (cost=0.00..184804.56 rows=8627356
> width=0)
You will always get seq scan when you select count(*) w
: Tuesday, March 25, 2008 4:18 PM
Subject: Re: [BUGS] BUG: PG do not use index
In response to [EMAIL PROTECTED]:
Why PG do not use index?
The standard question: when was the last time you did a vacuum analyze
on this table?
select max(id) from akh_testing_result
For MySQL this query take
wer.
- Original Message -
From: "Bill Moran" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, March 25, 2008 4:18 PM
Subject: Re: [BUGS] BUG: PG do not use index
In response to [EMAIL PROTECTED]:
Why PG do not use index?
The standard question: when
C:\Program Files\PostgreSQL\8.0\bin>postgres --version
postgres (PostgreSQL) 8.0.3
- Original Message -
From: "Alvaro Herrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, March 25, 2008 1:55 PM
Subject: Re: [BUGS] BUG: PG do not use index
In response to [EMAIL PROTECTED]:
> Why PG do not use index?
The standard question: when was the last time you did a vacuum analyze
on this table?
>
> select max(id) from akh_testing_result
> For MySQL this query take 2-3ms, but Postgres take 132 000ms to execute query.
>
> select max(id) from
[EMAIL PROTECTED] wrote:
> Why PG do not use index?
> select max(id) from akh_testing_result
What PG version are you using? Recent versions should indeed use the
index. Perhaps you just need to upgrade.
--
Alvaro Herrerahttp://www.CommandPrompt.com/
The Postgre
Why PG do not use index?
select max(id) from akh_testing_result
For MySQL this query take 2-3ms, but Postgres take 132 000ms to execute query.
select max(id) from akh_testing_result
Query executed in 2,12 minutes, 1 Record(s) Returned
--