"Reuven M. Lerner" <reuven@xxxxxxxxxxxx> writes: > Hi, everyone. I've been using PostgreSQL for a decade, and it hasn't > failed me yet. But I've been having some serious performance problems > on a database that I've been using in my grad-school research group, and > it's clear that I need help from some more experienced hands. What PG version are you using? > In theory, this would be the way to go. In practice, every step has > become a performance nightmare, taking many more hours than I might have > hoped or expected. For example, I've got a Pl/PgSQL function that goes > through each variable-assignment row, and UPDATEs is previous_value > column with whatever the previous value might have been. I'd try to think of a way to eliminate the function altogether in favor of a single UPDATE command. In general, row-at-a-time thinking isn't the way to win in SQL. regards, tom lane