Re: Problem: query becomes slow when calling a fast user defined function.

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

 



Dan Libby <dan@xxxxxxxxx> writes:
> Or failing that, I'd at least like to understand why the planner 
> is deciding not to use the category_lang index when the result 
> set is coming from a function instead of a "regular" table.

The planner defaults to assuming that set-returning functions return
1000 rows (as you can see in the EXPLAIN output).  A plan that would
win for a single returned row would lose badly at 1000 rows ...
and vice versa.  See the archives for various debates about how to
get a better estimate; it's not an easy problem.

			regards, tom lane


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux