Search Postgresql Archives

Re: Mechanics of Select

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

 



Willem Buitendyk <willem@xxxxxxxxx> writes:
> I have the following function that returns the first day of the next 
> month from whatever date is inserted.  If I use this as part of a select 
> statement then it takes almost twice as long to perform.  Is this 
> because for each scanned record this function is being called?  If so 
> any ideas how I could make this only occur once?

Don't declare it VOLATILE, when (AFAICS) you have no reason to.
It would be evaluated only once if it were marked IMMUTABLE.

BTW, I think you're doing it the hard way --- this could almost
certainly be a one-liner if you were using the available date
arithmetic facilities.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[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