Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2056f8a

Browse files
committed
pgindent C file, per patch request.
1 parent3bf080d commit2056f8a

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

‎contrib/pg_autovacuum/pg_autovacuum.c

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ init_table_info(PGresult *res, int row, db_info * dbi)
9696
returnNULL;
9797
}
9898

99-
/* Put both the schema and table name in quotes so that
100-
we can work with mixed case table names */
99+
/*
100+
* Put both the schema and table name in quotes so that we can work
101+
* with mixed case table names
102+
*/
101103
strcpy(new_tbl->table_name,"\"");
102104
strcat(new_tbl->table_name,new_tbl->schema_name);
103105
strcat(new_tbl->table_name,"\".\"");
@@ -120,9 +122,9 @@ init_table_info(PGresult *res, int row, db_info * dbi)
120122

121123
log_entry(PQgetvalue(res,row,PQfnumber(res,"relisshared")));
122124
if (strcmp("t",PQgetvalue(res,row,PQfnumber(res,"relisshared"))))
123-
new_tbl->relisshared=0;
125+
new_tbl->relisshared=0;
124126
else
125-
new_tbl->relisshared=1;
127+
new_tbl->relisshared=1;
126128

127129
new_tbl->analyze_threshold=
128130
args->analyze_base_threshold+args->analyze_scaling_factor*new_tbl->reltuples;
@@ -748,7 +750,7 @@ send_query(const char *query, db_info * dbi)
748750
returnNULL;
749751

750752
if (args->debug >=4)
751-
log_entry(query);
753+
log_entry(query);
752754

753755
res=PQexec(dbi->conn,query);
754756

@@ -961,7 +963,7 @@ main(int argc, char *argv[])
961963
intj=0,
962964
loops=0;
963965

964-
/*int numInserts, numDeletes, */
966+
/*int numInserts, numDeletes, */
965967
intsleep_secs;
966968
Dllist*db_list;
967969
Dlelem*db_elem,
@@ -1052,9 +1054,9 @@ main(int argc, char *argv[])
10521054

10531055
if (0==xid_wraparound_check(dbs));
10541056
{
1055-
res=send_query(TABLE_STATS_QUERY,dbs);/* Get an updated
1056-
* snapshot of this dbs
1057-
* table stats */
1057+
res=send_query(TABLE_STATS_QUERY,dbs);/* Get an updated
1058+
* snapshot of this dbs
1059+
* table stats */
10581060
for (j=0;j<PQntuples(res);j++)
10591061
{/* loop through result set */
10601062
tbl_elem=DLGetHead(dbs->table_list);/* Reset tbl_elem to top
@@ -1084,11 +1086,14 @@ main(int argc, char *argv[])
10841086
*/
10851087
if ((tbl->curr_vacuum_count-tbl->CountAtLastVacuum) >=tbl->vacuum_threshold)
10861088
{
1087-
/* if relisshared = t and database != template1 then only do an analyze */
1088-
if((tbl->relisshared>0)&& (strcmp("template1",dbs->dbname)))
1089-
snprintf(buf,sizeof(buf),"ANALYZE %s",tbl->table_name);
1090-
else
1091-
snprintf(buf,sizeof(buf),"VACUUM ANALYZE %s",tbl->table_name);
1089+
/*
1090+
* if relisshared = t and database !=
1091+
* template1 then only do an analyze
1092+
*/
1093+
if ((tbl->relisshared>0)&& (strcmp("template1",dbs->dbname)))
1094+
snprintf(buf,sizeof(buf),"ANALYZE %s",tbl->table_name);
1095+
else
1096+
snprintf(buf,sizeof(buf),"VACUUM ANALYZE %s",tbl->table_name);
10921097
if (args->debug >=1)
10931098
{
10941099
sprintf(logbuffer,"Performing: %s",buf);
@@ -1102,7 +1107,7 @@ main(int argc, char *argv[])
11021107
}
11031108
elseif ((tbl->curr_analyze_count-tbl->CountAtLastAnalyze) >=tbl->analyze_threshold)
11041109
{
1105-
snprintf(buf,sizeof(buf),"ANALYZE %s",tbl->table_name);
1110+
snprintf(buf,sizeof(buf),"ANALYZE %s",tbl->table_name);
11061111
if (args->debug >=1)
11071112
{
11081113
sprintf(logbuffer,"Performing: %s",buf);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp