Re: PG index architecture

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: Andy Colson <andy(at)squeakycode(dot)net>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: PG index architecture
Date: 2014-07-15 20:43:08
Message-ID: A76B25F2823E954C9E45E32FA49D70EC919CDED8@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] On Behalf Of Andy Colson
> Sent: Tuesday, July 15, 2014 4:27 PM
> To: pgsql
> Subject: [GENERAL] PG index architecture
>
> I was thinking about indexes, and am kinda curious about sequential access.
>
> I know nothing of PG guts, so this might even be a dumb question.
>
> As I understand indexes, they are a key value pair, that contain a value and a
> position. You lookup the value then use the position to seek into the
> database to load the record.
>
> Do we, or could we, load all the the matching index records, then sort them
> by position? (maybe not all, maybe large batches)
>
> When loading from the database, if access was slightly more sequential (vs
> very random), would it increase performance?
>
> Said another way:
>
> I think of table scanning as sequential, and fast. That would be loading db
> record 1,2,3, etc.
>
> Would it be faster to load db records "mostly sequential": 1,3,4,7,10
> compared to randomly: 7,3,10,1,4
>
> -Andy
>

It is called CLUSTER:

http://www.postgresql.org/docs/9.2/static/sql-cluster.html

Regards,
Igor Neyman

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-07-15 20:51:54 Re: PG index architecture
Previous Message Adrian Klaver 2014-07-15 20:34:22 Re: php password authentication failed for user ...