Re: Why my query not doing index only scan

From: Arup Rakshit <ar(at)zeit(dot)io>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Why my query not doing index only scan
Date: 2018-09-10 11:53:42
Message-ID: BDE6665D-3EF7-458C-9788-7F48D86C9928@zeit.io
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Stephen. After running the vacuum on the table it worked.

inspection_development=# explain analyze select item_code from inspector_tool_components where company_id = '7881ff2e-0557-4734-9da8-2d33072ff1ef';
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Index Only Scan using inspector_tool_idx4_1 on inspector_tool_components (cost=0.41..57.87 rows=1226 width=8) (actual time=0.044..0.626 rows=1232 loops=1)
Index Cond: (company_id = '7881ff2e-0557-4734-9da8-2d33072ff1ef'::uuid)
Heap Fetches: 0
Planning time: 0.190 ms
Execution time: 0.778 ms
(5 rows)

Thanks,

Arup Rakshit
ar(at)zeit(dot)io

> On 10-Sep-2018, at 4:58 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
>
> VACUUM

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arup Rakshit 2018-09-10 12:40:09 Re: Why my query not doing index only scan
Previous Message Stephen Frost 2018-09-10 11:28:17 Re: Why my query not doing index only scan