Search Postgresql Archives

Re: index and queries using '<' '>'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marc Boucher <pgml@xxxxxxx> writes:
>> Index scans aren't always faster than sequential scans.

> I know that, but I've some comparisons with other queries. And someone
> advised me to try "set enable_seqscan=off;". It takes 50-60% (after
> checking right now) less to use the index. Unfortunately I can't use this
> setting, the query being part of a larger query (joins), and the time
> gained on this particular index is partially lost on the joins.

A less brute-force way of encouraging the planner to use indexscans is
to reduce the random_page_cost setting.  It defaults to 4 but many
people find that values nearer 2 are more representative of what happens
in their environments.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux