You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'SELECT format(''{"value": %s, "estimated" : true}'', tablesize)::jsonb as tablesize, '
239
+
||' format(''{"value": %s, "estimated" : true}'', count)::jsonb as count, '
240
+
||' format(''{"value": %s, "estimated" : false}'', COALESCE(maxversion,0))::jsonb as maxversion, '
241
+
||' format(''{"value": %s, "estimated" : false}'', COALESCE(minversion,0))::jsonb as minversion '
242
+
||' FROM ('
243
+
||'SELECT pg_total_relation_size('''||schema||'."'||spaceid||'"'') AS tablesize, '
244
+
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'" where jsondata->''properties''->''@ns:com:here:xyz''->''version'' is not null'
245
+
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' DESC limit 1 )::TEXT::INTEGER as maxversion,'
246
+
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'"'
247
+
||' WHERE jsondata->''properties''->''@ns:com:here:xyz''->''version'' > to_jsonb(0::numeric) '
248
+
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' ASC limit 1 )::TEXT::INTEGER as minversion,'
249
+
||' reltuples AS count '
250
+
||'FROM pg_class '
251
+
||' WHERE oid='''||schema||'."'||spaceid||'"''::regclass) A';
252
252
ELSE
253
-
RETURN QUERY EXECUTE
254
-
'SELECT format(''{"value": %s, "estimated" : true}'', tablesize)::jsonb as tablesize, '
255
-
||'format(''{"value": %s, "estimated" : false}'', count)::jsonb as count, '
256
-
||'format(''{"value": %s, "estimated" : false}'', COALESCE(maxversion,0))::jsonb as maxversion, '
257
-
||'format(''{"value": %s, "estimated" : false}'', COALESCE(minversion,0))::jsonb as minversion '
258
-
||'FROM ('
259
-
||'SELECT pg_total_relation_size('''||schema||'."'||spaceid||'"'') AS tablesize, '
260
-
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'"'
261
-
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' DESC limit 1 )::TEXT::INTEGER as maxversion,'
262
-
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'"'
263
-
||' WHERE jsondata->''properties''->''@ns:com:here:xyz''->''version'' > to_jsonb(0::numeric) '
264
-
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' ASC limit 1 )::TEXT::INTEGER as minversion,'
265
-
||' (SELECT count(*) FROM "'||schema||'"."'||spaceid||'") AS count '
'SELECT format(''{"value": %s, "estimated" : true}'', tablesize)::jsonb as tablesize, '
255
+
||' format(''{"value": %s, "estimated" : false}'', count)::jsonb as count, '
256
+
||' format(''{"value": %s, "estimated" : false}'', COALESCE(maxversion,0))::jsonb as maxversion, '
257
+
||' format(''{"value": %s, "estimated" : false}'', COALESCE(minversion,0))::jsonb as minversion '
258
+
||' FROM ('
259
+
||'SELECT pg_total_relation_size('''||schema||'."'||spaceid||'"'') AS tablesize, '
260
+
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'" where jsondata->''properties''->''@ns:com:here:xyz''->''version'' is not null'
261
+
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' DESC limit 1 )::TEXT::INTEGER as maxversion,'
262
+
||'(SELECT jsondata->''properties''->''@ns:com:here:xyz''->''version'' FROM "'||schema||'"."'||spaceid||'"'
263
+
||' WHERE jsondata->''properties''->''@ns:com:here:xyz''->''version'' > to_jsonb(0::numeric) '
264
+
||'order by jsondata->''properties''->''@ns:com:here:xyz''->''version'' ASC limit 1 )::TEXT::INTEGER as minversion,'
265
+
||' (SELECT count(*) FROM "'||schema||'"."'||spaceid||'") AS count '
266
+
||'FROM pg_class '
267
+
||' WHERE oid='''||schema||'."'||spaceid||'"''::regclass) A';
268
268
END IF;
269
269
END;
270
270
$BODY$
@@ -1150,7 +1150,7 @@ $BODY$
1150
1150
EXECUTE FORMAT ('DROP INDEX IF EXISTS %s."%s" ', schema, xyz_needless_manual_idx.idx_name);
1151
1151
END LOOP;
1152
1152
1153
-
/** Check if auto-indexing is turend off - if yes, delete auto-indices */
1153
+
/** Check if auto-indexing is turned off - if yes, delete auto-indices */
1154
1154
select auto_indexing fromxyz_config.xyz_idxs_status into is_auto_indexing where spaceid = space;
0 commit comments