Skip site navigation (1) Skip section navigation (2)

Re: BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "John E(dot) Rylander" <rylander(at)prolexia(dot)com>
Cc: "'Jim C(dot) Nasby'" <jnasby(at)pervasive(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2477: Aggregate Integer divisors incorrectly yield integer-type quotient
Date: 2006-06-13 14:55:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
"John E. Rylander" <rylander(at)prolexia(dot)com> writes:
> ... 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.

It might be possible to teach the system that it could immediately
unlink the table file when dropping a table that was created in the
current transaction.  See the NOTE in smgrscheduleunlink() for a hint
about one way to do it.  I think you'd have to worry about matching
subtransaction nest levels, but if they're the same then allowing
inverse unlink requests to "blow each other up" would work.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-06-13 14:57:18
Subject: Re: Compile Errors, 8.1.4 On Solaris 8 x86
Previous:From: Bruce MomjianDate: 2006-06-13 12:58:10
Subject: Re: BUG #2478: PQescapeStringConn

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group