pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Melvin Davidson <melvin6925@gmail.com>
To: Jacek KoƂodziej <kolodziejj@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: READ COMMITTED vs. index-only scans
Date: Wed, 17 Jan 2018 16:17:06 +0100
Message-ID: <1516202226.2799.37.camel@cybertec.at> (raw)
In-Reply-To: <CANu8FiznGYHJURot3+4Yo_chptQC4PpGb=thyOVbV_+56=ymzg@mail.gmail.com>
References: <CAB=Xmr7uCWN7Jbvp5VxQ699EXBF3T_7ZCxz1N9xcsuNpoFgeOg@mail.gmail.com>
	<CANu8FiznGYHJURot3+4Yo_chptQC4PpGb=thyOVbV_+56=ymzg@mail.gmail.com>

Melvin Davidson wrote:
> You can simply do:
> second query (B): 
> 
> SELECT id
> , ... 
>   FROM events 
>  WHERE id > MIN(ID) 
>    AND id <= MAX(ID)
>    AND ...

You probably meant to use a window function there:

  max(id) OVER ()
  min(id) OVER ()

Yours,
Laurenz Albe




view thread (10+ messages)  latest in thread

Message-ID: <1516202226.2799.37.camel@cybertec.at>
Permalink:  ../1516202226.2799.37.camel@cybertec.at/
Also on:    postgresql.org/message-id/1516202226.2799.37.camel@cybertec.at

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, melvin6925@gmail.com, kolodziejj@gmail.com
  Subject: Re: READ COMMITTED vs. index-only scans
  In-Reply-To: <1516202226.2799.37.camel@cybertec.at>
  References: <CAB=Xmr7uCWN7Jbvp5VxQ699EXBF3T_7ZCxz1N9xcsuNpoFgeOg@mail.gmail.com> <CANu8FiznGYHJURot3+4Yo_chptQC4PpGb=thyOVbV_+56=ymzg@mail.gmail.com> <1516202226.2799.37.camel@cybertec.at>

* 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