Re: [PERFORM] Slow query with 3 table joins

Поиск
Список
Период
Сортировка
От Alessandro Ferrucci
Тема Re: [PERFORM] Slow query with 3 table joins
Дата
Msg-id CAMgh6pJ_i+w-xP+FJiNbz6pSKJDbHnaYPyh9bnb5xUYr4PBH6g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PERFORM] Slow query with 3 table joins  (Johan Fredriksson <eskil@kth.se>)
Ответы Re: [PERFORM] Slow query with 3 table joins  (Johan Fredriksson <eskil@kth.se>)
Список 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 по дате отправления:

Предыдущее
От: Johan Fredriksson
Дата:
Сообщение: Re: [PERFORM] Slow query with 3 table joins
Следующее
От: Alessandro Ferrucci
Дата:
Сообщение: Re: [PERFORM] Slow query with 3 table joins