pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Andrey Osenenko <andrey.osenenko@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: GIN index always doing Re-check condition, postgres 9.1
Date: Mon, 2 Nov 2015 12:28:18 -0600
Message-ID: <5637AB42.9010403@BlueTreble.com> (raw)
In-Reply-To: <CAEB3-FhUJQDrv9oSH=f7ygXPLL7zPMK+TQiaKj0iM1zbfqdPOA@mail.gmail.com>
References: <CAEB3-FhsZxnFVeSD5Ahxph8TdmJh+Aw9n-RLLaFk6CNyb+MW4A@mail.gmail.com>
	<CAMkU=1xHNNLS-qKToVDCCMRe0dUveENLOX0dEcU66MzCyW97+w@mail.gmail.com>
	<CAEB3-FhwWyAranGJRC2QvTw98s-mO2o1px=rZkJVkwfieaumWQ@mail.gmail.com>
	<CAEB3-FhUJQDrv9oSH=f7ygXPLL7zPMK+TQiaKj0iM1zbfqdPOA@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

On 11/2/15 2:19 AM, Andrey Osenenko wrote:
> It also looks like if there was a way to create a table with just
> primary key and add an index to it that indexes data from another table,
> it would work much, much faster since there would be very little to read
> from disk after index lookup. But looks like there isn't.

That probably wouldn't help as much as you'd hope, because heap tuples 
in Postgres have a minimum 24 byte overhead. Add in 8 bytes for bigint 
and that's 32 bytes extra per row.

I think what might gain you more is if you moved 9.2 and got index only 
scans. Though, if you're getting lossy results, I don't think that'll 
help [1].

> So am I correct in assumption that as the amount of rows grows, query
> times for rows that are not in memory (and considering how many of them
> there are, most won't be) will grow linearly?

Maybe, maybe not. Query times for data that has to come from the disk 
can vary wildly based on what other activity is happening on the IO 
system. Ultimately, your IO system can only do so many IOs Per Second.

[1] 
https://wiki.postgresql.org/wiki/Index-only_scans#Index-only_scans_and_index-access_methods
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (6+ messages)  latest in thread

Message-ID: <5637AB42.9010403@BlueTreble.com>
Permalink:  ../5637AB42.9010403@BlueTreble.com/
Also on:    postgresql.org/message-id/5637AB42.9010403@BlueTreble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: Jim.Nasby@BlueTreble.com, andrey.osenenko@gmail.com
  Subject: Re: GIN index always doing Re-check condition, postgres 9.1
  In-Reply-To: <5637AB42.9010403@BlueTreble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox