summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2009-07-13 22:56:30 +0000
committerBruce Momjian2009-07-13 22:56:30 +0000
commitb5dec6f4ec5380a76f8ac454dc7ec47dd7de0687 (patch)
tree8fbdbd0d456353d412bfd1dac394b8e1c7406268
parentaca3bad16a4f7de9eae70d1239305ec7f58dd2d2 (diff)
vacuumlo query cleanups
No need for VACUUM ANAYZE of newly created/populated temp table, just use analyze. No need to apologize for using subquery in DELETE anymore.
-rw-r--r--contrib/vacuumlo/vacuumlo.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c
index 3793cde010..2c5d6c7162 100644
--- a/contrib/vacuumlo/vacuumlo.c
+++ b/contrib/vacuumlo/vacuumlo.c
@@ -155,11 +155,11 @@ vacuumlo(char *database, struct _param * param)
PQclear(res);
/*
- * Vacuum the temp table so that planner will generate decent plans for
+ * Analyze the temp table so that planner will generate decent plans for
* the DELETEs below.
*/
buf[0] = '\0';
- strcat(buf, "VACUUM ANALYZE vacuum_l");
+ strcat(buf, "ANALYZE vacuum_l");
res = PQexec(conn, buf);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
@@ -216,11 +216,6 @@ vacuumlo(char *database, struct _param * param)
if (param->verbose)
fprintf(stdout, "Checking %s in %s.%s\n", field, schema, table);
- /*
- * The "IN" construct used here was horribly inefficient before
- * Postgres 7.4, but should be now competitive if not better than the
- * bogus join we used before.
- */
snprintf(buf, BUFSIZE,
"DELETE FROM vacuum_l "
"WHERE lo IN (SELECT \"%s\" FROM \"%s\".\"%s\")",