Re: [PERFORM] Slow query with 3 table joins - Mailing list pgsql-performance

From Alessandro Ferrucci
Subject Re: [PERFORM] Slow query with 3 table joins
Date
Msg-id CAMgh6pJ_i+w-xP+FJiNbz6pSKJDbHnaYPyh9bnb5xUYr4PBH6g@mail.gmail.com
Whole thread Raw
In response to Re: [PERFORM] Slow query with 3 table joins  (Johan Fredriksson <eskil@kth.se>)
Responses Re: [PERFORM] Slow query with 3 table joins
List pgsql-performance
Hi Eskil -

The I believe the id-field you're referring to is the UNIT.UNIT_ID, I could change this to a varchar, however that column is not used in the query in question, so that wouldn't have any effect on the query's performance.

Just for curiosity - I have changed the ANSWER.ANS datatype to a varchar(250), but that did not affect the performance of the query.



On Wed, Apr 26, 2017 at 2:24 AM, Johan Fredriksson <eskil@kth.se> wrote:
tis 2017-04-25 klockan 23:19 -0400 skrev Alessandro Ferrucci:
> After about 40 inutes the slow query finally finished and the result
> of the EXPLAIN plan can be found here:
>
>
> https://explain.depesz.com/s/BX22
>
>
> Thanks,
> Alessandro Ferrucci

I'm not so familiar with the index implementetion in Postgres, but I
don't think it is very efficient to index a text-field. It also loooks a
bit strange that a id-field has the datatype "text" rather than integer
or varchar.

        / Eskil





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



--
Signed,
Alessandro Ferrucci

pgsql-performance by date:

Previous
From: Johan Fredriksson
Date:
Subject: Re: [PERFORM] Slow query with 3 table joins
Next
From: Alessandro Ferrucci
Date:
Subject: Re: [PERFORM] Slow query with 3 table joins