Tina Messmann <tina.messmann@xinux.de> writes:
> [ appid < 10 uses an index, appid > 10 does not ]
This is not wrong. An indexscan only wins over a sequential scan if the
indexscan can scan a fairly small percentage of the table --- the
critical percentage varies, but let's say it's 5%. If appid < 10
selects less than 5% of the table, then appid > 10 must select more than
95% of the table. Accordingly, choosing a seqscan for the second query
is the right thing to do.
regards, tom lane