![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
When for some reason I did a sum/count instead of an avg, the result was always an integer (either 0 or 1): |
|
Yet another maddening PostgreSQL bug/idiosyncrasy. Time for this boy to go to Oracle |
#2
| |||
| |||
|
|
The following bug has been logged online: Bug reference: 2477 Logged by: John Rylander Email address: rylander (AT) prolexia (DOT) com PostgreSQL version: 8.1.4 Operating system: Windows XP ![]() Description: Aggregate Integer divisors incorrectly yield integer-type quotient Details: When for some reason I did a sum/count instead of an avg, the result was always an integer (either 0 or 1): Sum( Case when Sign(Delta)=Sign(AvgDelta) then 1 else 0 ) / Count(*) as HitRate; If I use "/ Count(*)::float4", or use Avg instead of Sum/Count, it works fine. |
|
Yet another maddening PostgreSQL bug/idiosyncrasy. Time for this boy to go to Oracle (not because of this, but because of the function->transaction problem, such that a function that has nested loops that create myriad temporary analytical tables necessarily runs out of disk space; if it weren't for the mandatory and completely counterproductive implicit transaction, it'd take very little space and a lot less time). ![]() |
#3
| |||
| |||
|
|
... I have a PL/PGSQL analytical function that iteratively drops a table, queries to create a new table of the same name based on iterated parameters, and then runs numerous queries on the resulting table, storing a few summary records to a log table. The nested loops in the function intelligently iterate tens or hundreds of thousands of times on tables containing tens or low-hundreds of thousands of records. The problem is, I think, since this function is involuntarily wrapped in a transaction, PostgreSQL wastes a TON of time and space keeping track of every single interim table, and eventually (pretty soon, in fact) it runs out of disk space. |
![]() |
| Thread Tools | |
| Display Modes | |
| |