File tree Expand file tree Collapse file tree
vectordb_bench/backend/clients/pgdiskann Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,35 +82,6 @@ def __init__(
8282 self .cursor = None
8383 self .conn = None
8484
85- def get_size_info (self ):
86- try :
87- assert self .conn is not None , "Connection is not initialized"
88- assert self .cursor is not None , "Cursor is not initialized"
89- log .info (f"{ self .name } client get size info." )
90-
91- size_sql = sql .SQL (
92- "SELECT pg_size_pretty(pg_table_size('{table_name}')) as table_size, pg_size_pretty(pg_table_size('{index_name}')) as index_size;"
93- ).format (
94- table_name = sql .Identifier (self .table_name ),
95- index_name = sql .Identifier (self ._index_name ),
96- )
97- log .debug (size_sql .as_string (self .cursor ))
98- self .cursor .execute (size_sql )
99- self .conn .commit ()
100- result = self .cursor .fetchone ()
101-
102- if result :
103- table_size = result [0 ]
104- index_size = result [1 ]
105- log .info (f"Table Size: { table_size } , Index Size: { index_size } " )
106- return (table_size , index_size )
107- else :
108- log .error ("No results returned from the query." )
109- return (0 , 0 )
110- except Exception as e :
111- log .warning ("Failed to fetch table and index information" )
112- return (0 , 0 )
113-
11485 @staticmethod
11586 def _create_connection (** kwargs ) -> tuple [Connection , Cursor ]:
11687 conn = psycopg .connect (** kwargs )
You can’t perform that action at this time.
0 commit comments