pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luís Roberto Weck <luisroberto@siscobra.com.br>
To: Michael Lewis <mlewis@entrata.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re:
Date: Mon, 12 Aug 2019 19:43:54 -0300
Message-ID: <e3e3f5e059d212c962d8cdb128837549@siscobra.com.br> (raw)
In-Reply-To: <CAHOFxGpUwcjhs9trJwAkNNhY8doyi2shzCr=2ymLk+-3RzJhrA@mail.gmail.com>
References: <f2188f91-12ea-cd2b-40b9-eef4a1367252@siscobra.com.br>
	<CAHOFxGqhh5T2Uidw6ha404kiX87ipgs4MCGKOoDOqsp=j4Z89g@mail.gmail.com>
	<3fba6c11d158490b07afebc5a21c7aa9@siscobra.com.br>
	<CAHOFxGpUwcjhs9trJwAkNNhY8doyi2shzCr=2ymLk+-3RzJhrA@mail.gmail.com>

> It seems like it should be-
> 
> SELECT * FROM users u JOIN last_user_event_1 e USING (user_id,user_group); 
> --OR-- 
> SELECT * FROM last_user_event_2 e; 
> 
> for them to produce the same result set, since the last_user_event_2 already (could) have users info in it very simply by select * instead of e.* in that view definition. 
> 
> Are there other important joins/where/order by/limits that would be on this "main query" that is just SELECT * FROM ____ right now which you have dropped to try to simplify the example?

You're right about the queries, I made a mistake. 

Yes, I'm going to filter them by user_id and user_group, possibly (but
not likely) using LIMIT 1. In the explain examples I am using user_id =
1272897 and user_group = 19117

view thread (9+ messages)  latest in thread

Message-ID: <e3e3f5e059d212c962d8cdb128837549@siscobra.com.br>
Permalink:  ../e3e3f5e059d212c962d8cdb128837549@siscobra.com.br/
Also on:    postgresql.org/message-id/e3e3f5e059d212c962d8cdb128837549@siscobra.com.br

 · 

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: luisroberto@siscobra.com.br, mlewis@entrata.com, pgsql-performance@lists.postgresql.org
  Subject: Re:
  In-Reply-To: <e3e3f5e059d212c962d8cdb128837549@siscobra.com.br>

* 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