@@ -73,7 +73,7 @@ use graph::data::store::{Id, IdList, IdType, BYTES_SCALAR};
73
73
use graph:: data:: subgraph:: schema:: POI_TABLE ;
74
74
use graph:: prelude:: {
75
75
anyhow, info, BlockNumber , DeploymentHash , Entity , EntityChange , EntityOperation , Logger ,
76
- QueryExecutionError , StoreError , StoreEvent , ValueType , BLOCK_NUMBER_MAX ,
76
+ QueryExecutionError , StoreError , StoreEvent , ValueType ,
77
77
} ;
78
78
79
79
use crate :: block_range:: { BoundSide , BLOCK_COLUMN , BLOCK_RANGE_COLUMN } ;
@@ -231,8 +231,6 @@ pub struct Layout {
231
231
pub tables : HashMap < EntityType , Arc < Table > > ,
232
232
/// The database schema for this subgraph
233
233
pub catalog : Catalog ,
234
- /// The query to count all entities
235
- pub count_query : String ,
236
234
/// How many blocks of history the subgraph should keep
237
235
pub history_blocks : BlockNumber ,
238
236
@@ -290,25 +288,6 @@ impl Layout {
290
288
) )
291
289
}
292
290
293
- let count_query = tables
294
- . iter ( )
295
- . map ( |table| {
296
- if table. immutable {
297
- format ! (
298
- "select count(*) from \" {}\" .\" {}\" " ,
299
- & catalog. site. namespace, table. name
300
- )
301
- } else {
302
- format ! (
303
- "select count(*) from \" {}\" .\" {}\" where block_range @> {}" ,
304
- & catalog. site. namespace, table. name, BLOCK_NUMBER_MAX
305
- )
306
- }
307
- } )
308
- . collect :: < Vec < _ > > ( )
309
- . join ( "\n union all\n " ) ;
310
- let count_query = format ! ( "select sum(e.count) from ({}) e" , count_query) ;
311
-
312
291
let tables: HashMap < _ , _ > = tables
313
292
. into_iter ( )
314
293
. fold ( HashMap :: new ( ) , |mut tables, table| {
@@ -322,7 +301,6 @@ impl Layout {
322
301
site,
323
302
catalog,
324
303
tables,
325
- count_query,
326
304
history_blocks : i32:: MAX ,
327
305
input_schema : schema. cheap_clone ( ) ,
328
306
rollups,
0 commit comments