Re: SeqScan vs. IndexScan

2018-04-18 Thread Tom Lane
Vitaliy Garnashevich writes: > I'm running the same query with "set enable_seqscan = on;" and "set > enable_seqscan = off;": > ... > Why optimizer is choosing SeqScan (on cmn_user) in the first query, > instead of an IndexScan, despite of SeqScan being more costly? Because it cares about the to

SeqScan vs. IndexScan

2018-04-18 Thread Vitaliy Garnashevich
Hi, I'm running the same query with "set enable_seqscan = on;" and "set enable_seqscan = off;": ->  Nested Loop Left Join  (cost=0.00..89642.86 rows=1 width=30) (actual time=1.612..6924.232 rows=3289 loops=1)   Join Filter: (sys_user.user_id = j_6634.id)   Rows Removed by Join Filter