From: | Jan Nielsen <jan(dot)sture(dot)nielsen(at)gmail(dot)com> |
---|---|
To: | legrand legrand <legrand_legrand(at)hotmail(dot)com> |
Cc: | "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: SELECT performance drop |
Date: | 2019-01-24 18:04:57 |
Message-ID: | CANxH4hEvgeitLDCcW_ZHpoGRgnBN69=9A-rnzxWVOvRYzsoU0A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
With Pascal's suggestion, I added a new index:
CREATE INDEX fm_order_sid_type_idx ON fm_order (session_id, type);
which improved the query to 2mS!
https://explain.depesz.com/s/oxvs
Thank you, Pascal!
On Thu, Jan 24, 2019 at 9:52 AM Jan Nielsen <jan(dot)sture(dot)nielsen(at)gmail(dot)com>
wrote:
>
>
> On Wed, Jan 23, 2019 at 12:37 PM legrand legrand <
> legrand_legrand(at)hotmail(dot)com> wrote:
>
>> Hi,
>> is there an index on
>> fm_order(session_id,type)?
>>
>
> There isn't at the moment:
>
> table_name | index_name | column_name
> ----------------+------------------------------+-------------
> fm_account | fm_account_pkey | id
> fm_account | uk_5p6qalvucbxmw9u64wf0aif9d | name
> fm_allocation | fm_allocation_pkey | id
> fm_approval | fm_approval_pkey | id
> fm_capital | fm_capital_pkey | id
> fm_grant | fm_grant_pkey | id
> fm_market | fm_market_pkey | id
> fm_marketplace | fm_marketplace_pkey | id
> fm_order | fm_order_pkey | id
> fm_person | fm_person_pkey | id
> fm_session | fm_session_pkey | id
> fm_trader | fm_trader_pkey | id
>
>
>
>
>>
>> regards
>> PAscal
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | ldh@laurent-hasson.com | 2019-01-25 05:20:00 | Zero throughput on a query on a very large table. |
Previous Message | Jan Nielsen | 2019-01-24 16:52:03 | Re: SELECT performance drop |