Re:

From: Max Lipsky <maxlipsky(at)gmail(dot)com>
To: Steve Midgley <science(at)misuse(dot)org>
Cc: postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: Re:
Date: 2016-06-03 01:42:49
Message-ID: 7FBA5CC1-157B-476F-980B-686824D477F6@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sorry, I send broken link
New link >> https://www.dropbox.com/s/8g3tkrikeap89q9/text.zip?dl=0 <https://www.dropbox.com/s/8g3tkrikeap89q9/text.zip?dl=0>

> On 03 Jun 2016, at 03:28, Steve Midgley <science(at)misuse(dot)org> wrote:
>
> In order to answer questions like that, generally, it's super helpful if you will include the "EXPLAIN" output for the query. It may also be useful to share some simple DDL stuff so we can create the tables and data you're using and try it out on our end.
>
> In this specific case (without digging too much into this, and without the info above) I'd guess there's an index missing and probably on the field "realisation_category_id"
>
> Steve
>
> On Thu, Jun 2, 2016 at 2:31 PM, Max Lipsky <maxlipsky(at)gmail(dot)com <mailto:maxlipsky(at)gmail(dot)com>> wrote:
> Hi All!
>
> Why is too much difference in time execution between these two queries:
>
>
> SELECT rc.id <http://rc.id/> AS id, rc.name <http://rc.name/>
> FROM realisation_category rc
> WHERE EXISTS (
> SELECT * FROM realisation r, post p WHERE (r.realisation_category_id = rc.id <http://rc.id/> AND r.site_id = 1)
> OR (p.realisation_category_id = rc.id <http://rc.id/> AND p.site_id = 1)
> )
> [2016-06-03 01:23:12] 35 row(s) retrieved starting from 1 in 14s 591ms (14s 612ms total)
>
>
>
> SELECT rc.id <http://rc.id/> AS id, rc.name <http://rc.name/>
> FROM realisation_category rc
> WHERE EXISTS (
> SELECT * FROM realisation r WHERE r.realisation_category_id = rc.id <http://rc.id/> AND r.site_id = 1
> ) OR EXISTS (
> SELECT * FROM post p WHERE p.realisation_category_id = rc.id <http://rc.id/> AND p.site_id = 1
> )
> [2016-06-03 01:25:25] 35 row(s) retrieved starting from 1 in 64ms (86ms total)
>
> Thanks
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql(at)postgresql(dot)org <mailto:pgsql-sql(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql <http://www.postgresql.org/mailpref/pgsql-sql>
>

In response to

  • Re: at 2016-06-03 00:28:05 from Steve Midgley

Responses

  • Re: at 2016-06-03 15:15:27 from Michael Moore

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Moore 2016-06-03 15:15:27 Re:
Previous Message Max Lipsky 2016-06-03 01:24:53 Re: