Search Postgresql Archives

Re: Which indexes does a query use?

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

 



Chris Velevitch wrote:

Are you saying that the strategy pg uses is dynamic, in that as the
size of the table grows the strategy changes?

The planner is quite dynamic, and what strategy it comes up with will depend not just on the size of the table, but other things as well, even on the particular constants in your comparisons. For instance, I think your original query had:

  where activity_user_id = 2

If the table statistics show that 2 is a very common value for that column, the planner will not use the index, as it will not save enough. (I think I have that right.)

- John D. Burger
  MITRE



[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