Re: More tablescanning fun - Mailing list pgsql-performance

From Tom Lane
Subject Re: More tablescanning fun
Date
Msg-id 3660.1051228710@sss.pgh.pa.us
Whole thread Raw
In response to More tablescanning fun  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: More tablescanning fun  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-performance
"Jim C. Nasby" <jim@nasby.net> writes:
> It seems like the metrics used for the cost of index scanning v. table
> scanning on large tables need to be revisited. It might be such a huge
> difference in this case because the table is essentially clustered on
> the primary key.

Probably.  What does the correlation figure in pg_stats show as?

There's been some previous debate about the equation used to correct
for correlation, which is certainly bogus (I picked it more or less
out of the air ;-)).  But so far no one has proposed a replacement
equation with any better foundation ... take a look in
src/backend/optimizer/path/costsize.c if you want to get involved.

> Also, is there a TODO to impliment
> real clustered indexes?

No.  It's not apparent to me how you could do that without abandoning
MVCC, which we're not likely to do.

            regards, tom lane


pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: More tablescanning fun
Next
From: "Jim C. Nasby"
Date:
Subject: Re: More tablescanning fun