I ran loops and intensively queried a lot of data in each loop. My database is built using Crate. Sometimes, the loops paused since Crate didn't respond back my query results. (This is not always happening though) The pseudo code is as follows
from crate import client
class data_access(object):
def __init__(self, IP):
conn = client.connect(IP)
self.cursor = conn.cursor()
def get_report(self, event_id):
self.cursor.execute('''
select schema.events."Info", schema.events."Time"
from schema.events
where schema.events."Id"='%s' ''' % event_id)
event = []
for row in self.cursor:
event.append((row[0], row[1]))
return event
dal = data_access("server IP")
all_events = []
for event_id in event_ids:
events = dal.get_report(event_id)
if len(events) >0: all_event += events
The length of event_ids
could be millions and in each loop the query is intensive. Did any DB experts who use Crate, experience this problems? If yes, how did you fix this? It seems rebooting the DB doesn't work. A ton of thanks for solution!