git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1ba294)
vacuumlo query cleanups
2009年7月13日 22:56:30 +0000 (22:56 +0000)
2009年7月13日 22:56:30 +0000 (22:56 +0000)
No need for VACUUM ANAYZE of newly created/populated temp table, just
use analyze.

No need to apologize for using subquery in DELETE anymore.


diff --git a/contrib/vacuumlo/vacuumlo.c b/contrib/vacuumlo/vacuumlo.c
index b26b42cf7a908828adcd21b598c454d01a21fd8c..a0a7d57922b1e41642e850388dcf18742dcddfcc 100644 (file)
--- a/contrib/vacuumlo/vacuumlo.c
+++ b/contrib/vacuumlo/vacuumlo.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.41 2009年02月27日 09:30:21 petere Exp $
+ * $PostgreSQL: pgsql/contrib/vacuumlo/vacuumlo.c,v 1.42 2009年07月13日 22:56:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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\")",
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /