Re: how fast index works? - Mailing list pgsql-performance

From Merlin Moncure
Subject Re: how fast index works?
Date
Msg-id CAHyXU0wgqZ6V5MR+n4Yzt9=VQ_ccU_kuPm8WdgGWjeywvzA0HQ@mail.gmail.com
Whole thread Raw
In response to how fast index works?  ("Anibal David Acosta" <aa@devshock.com>)
List pgsql-performance
On Tue, Sep 6, 2011 at 1:31 PM, Anibal David Acosta <aa@devshock.com> wrote:
> Hi everyone,
>
>
>
> My question is, if I have a table with 500,000 rows, and a SELECT of one row
> is returned in 10 milliseconds, if the table has 6,000,000 of rows and
> everything is OK (statistics, vacuum etc)
>
> can i suppose that elapsed time will be near to 10?

The problem with large datasets does not come from the index, but that
they increase cache pressure.  On today's typical servers it's all
about cache, and the fact that disks (at least non ssd drives) are
several orders of magnitude slower than memory.  Supposing you had
infinite memory holding your data files in cache or infinitely fast
disks, looking up a record from a trillion record table would still be
faster than reading a record from a hundred record table that had to
fault to a spinning disk to pull up the data.

merlin

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: how delete/insert/update affects select performace?
Next
From: "Anibal David Acosta"
Date:
Subject: Re: how delete/insert/update affects select performace?