Re: READ COMMITTED vs. index-only scans

2018-02-18 Thread Jacek Kołodziej
On Wed, Jan 17, 2018 at 9:34 PM, Jacek Kołodziej wrote: > Hi Tom, > > On Wed, Jan 17, 2018 at 7:56 PM, Tom Lane wrote: > >> =?UTF-8?Q?Jacek_Ko=C5=82odziej?= writes: >> > Here's what happening to me: the "A" query occasionally (in my case: on >> the >> > order of tenths per day) returns an ID _h

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Jacek Kołodziej
Hi Tom, On Wed, Jan 17, 2018 at 7:56 PM, Tom Lane wrote: > =?UTF-8?Q?Jacek_Ko=C5=82odziej?= writes: > > Here's what happening to me: the "A" query occasionally (in my case: on > the > > order of tenths per day) returns an ID _higher_ than any ID present in > > second query's result (other condi

RE: READ COMMITTED vs. index-only scans

2018-01-17 Thread Karen Stone
[mailto:t...@sss.pgh.pa.us] Sent: Wednesday, January 17, 2018 11:56 AM To: Jacek Kołodziej Cc: pgsql-general@lists.postgresql.org Subject: Re: READ COMMITTED vs. index-only scans =?UTF-8?Q?Jacek_Ko=C5=82odziej?= writes: > Here's what happening to me: the "A" query occasionally (in

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Tom Lane
=?UTF-8?Q?Jacek_Ko=C5=82odziej?= writes: > Here's what happening to me: the "A" query occasionally (in my case: on the > order of tenths per day) returns an ID _higher_ than any ID present in > second query's result (other conditions I haven't specified do _not_ filter > any more rows than "id <=

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Melvin Davidson
On Wed, Jan 17, 2018 at 10:45 AM, Jacek Kołodziej wrote: > > > 17.01.2018 3:30 PM "Melvin Davidson" napisał(a): > > > > On Wed, Jan 17, 2018 at 8:08 AM, Jacek Kołodziej > wrote: > >> Hello everyone, >> >> this is my first post here and I'm starting with asking a question about >> data consisten

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Jacek Kołodziej
17.01.2018 3:30 PM "Melvin Davidson" napisał(a): On Wed, Jan 17, 2018 at 8:08 AM, Jacek Kołodziej wrote: > Hello everyone, > > this is my first post here and I'm starting with asking a question about > data consistency between two consecutive SELECTs using PostgreSQL 9.6. > > I'm sorry if tha

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Francisco Olarte
On Wed, Jan 17, 2018 at 3:30 PM, Melvin Davidson wrote: > Just a suggestion. The first query is not really needed. > You can simply do: > second query (B): > > SELECT id > , ... > FROM events > WHERE id > MIN(ID) >AND id <= MAX(ID) >AND ... > > See https://www.postgresql.org/docs/9

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Laurenz Albe
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

Re: READ COMMITTED vs. index-only scans

2018-01-17 Thread Melvin Davidson
On Wed, Jan 17, 2018 at 8:08 AM, Jacek Kołodziej wrote: > Hello everyone, > > this is my first post here and I'm starting with asking a question about > data consistency between two consecutive SELECTs using PostgreSQL 9.6. > > I'm sorry if that's something that was already discussed - I couldn't