@@ -96,8 +96,10 @@ init_table_info(PGresult *res, int row, db_info * dbi)
9696return NULL ;
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+ */
101103strcpy (new_tbl -> table_name ,"\"" );
102104strcat (new_tbl -> table_name ,new_tbl -> schema_name );
103105strcat (new_tbl -> table_name ,"\".\"" );
@@ -120,9 +122,9 @@ init_table_info(PGresult *res, int row, db_info * dbi)
120122
121123log_entry (PQgetvalue (res ,row ,PQfnumber (res ,"relisshared" )));
122124if (strcmp ("t" ,PQgetvalue (res ,row ,PQfnumber (res ,"relisshared" ))))
123- new_tbl -> relisshared = 0 ;
125+ new_tbl -> relisshared = 0 ;
124126else
125- new_tbl -> relisshared = 1 ;
127+ new_tbl -> relisshared = 1 ;
126128
127129new_tbl -> analyze_threshold =
128130args -> analyze_base_threshold + args -> analyze_scaling_factor * new_tbl -> reltuples ;
@@ -748,7 +750,7 @@ send_query(const char *query, db_info * dbi)
748750return NULL ;
749751
750752if (args -> debug >=4 )
751- log_entry (query );
753+ log_entry (query );
752754
753755res = PQexec (dbi -> conn ,query );
754756
@@ -961,7 +963,7 @@ main(int argc, char *argv[])
961963int j = 0 ,
962964loops = 0 ;
963965
964- /* int numInserts, numDeletes, */
966+ /* int numInserts, numDeletes, */
965967int sleep_secs ;
966968Dllist * db_list ;
967969Dlelem * db_elem ,
@@ -1052,9 +1054,9 @@ main(int argc, char *argv[])
10521054
10531055if (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 */
10581060for (j = 0 ;j < PQntuples (res );j ++ )
10591061{/* loop through result set */
10601062tbl_elem = DLGetHead (dbs -> table_list );/* Reset tbl_elem to top
@@ -1084,11 +1086,14 @@ main(int argc, char *argv[])
10841086 */
10851087if ((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 );
10921097if (args -> debug >=1 )
10931098{
10941099sprintf (logbuffer ,"Performing: %s" ,buf );
@@ -1102,7 +1107,7 @@ main(int argc, char *argv[])
11021107}
11031108else if ((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 );
11061111if (args -> debug >=1 )
11071112{
11081113sprintf (logbuffer ,"Performing: %s" ,buf );