Re: Air-traffic benchmark

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: "Gurgel, Flavio" <flavio(at)4linux(dot)com(dot)br>
Cc: Matthew Wakeling <matthew(at)flymine(dot)org>, Lefteris <lsidir(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org, Ivan Voras <ivoras(at)freebsd(dot)org>
Subject: Re: Air-traffic benchmark
Date: 2010-01-07 18:02:13
Message-ID: dcc563d11001071002i38214570if8fcc738021116fe@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Jan 7, 2010 at 10:57 AM, Gurgel, Flavio <flavio(at)4linux(dot)com(dot)br> wrote:
> ----- "Matthew Wakeling" <matthew(at)flymine(dot)org> escreveu:
>> On Thu, 7 Jan 2010, Gurgel, Flavio wrote:
>> Postgres does not change a query plan according to the shared_buffers
>>
>> setting. It does not anticipate one step contributing to another step
>> in
>> this way. It does however make use of the effective_cache_size setting
>> to
>> estimate this effect, and that does affect the planner.
>
> That was what I was trying to say :)
>
>> In a situation like this, the opposite will be true. If you were
>> accessing
>> a very small part of a table, say to order by a field with a small
>> limit,
>> then an index can be very useful by providing the results in the
>> correct
>> order. However, in this case, almost the entire table has to be read.
>>
>> Changing the order in which it is read will mean that the disc access
>> is
>> no longer sequential, which will slow things down, not speed them up.
>>
>> The Postgres planner isn't stupid (mostly), there is probably a good
>> reason why it isn't using an index scan.
>
> Sorry but I disagree. This is the typical case where the test has to be made.
> The results are partial, let's say 50% of the table. Considerind that the disk is fast enough, the cost estimation of sequential and random reads are in a proportion of 1 to 4, considering default settings in PostgreSQL.

You do know that indexes in postgresql are not "covering" right? I.e.
after hitting the index, the db then has to hit the table to see if
those rows are in fact visible. So there's no such thing in pgsql, at
the moment, as an index only scan.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Gurgel, Flavio 2010-01-07 18:10:21 Re: Air-traffic benchmark
Previous Message Gurgel, Flavio 2010-01-07 17:57:01 Re: Air-traffic benchmark