Re: Why my query not doing index only scan - Mailing list pgsql-general

From Arup Rakshit
Subject Re: Why my query not doing index only scan
Date
Msg-id BDE6665D-3EF7-458C-9788-7F48D86C9928@zeit.io
Whole thread Raw
In response to Re: Why my query not doing index only scan  (Stephen Frost <sfrost@snowman.net>)
List 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



On 10-Sep-2018, at 4:58 PM, Stephen Frost <sfrost@snowman.net> wrote:

VACUUM

pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Why my query not doing index only scan
Next
From: Arup Rakshit
Date:
Subject: Re: Why my query not doing index only scan