mardi 29 mars 2016

Is there a way to speed up database transactions?

sorry for the vague question, let me explain...

I have a list of words and counts in a database that has no doubt reached a gigantic amount. ~80mb database with each entry being two columns (word, integer)

Now when I am trying to add a word, I check tos ee if it si already in the database like this...python sqlite3 class method...

self.c.execute('SELECT * FROM {tn} WHERE {cn} = """{wn}"""'.format(tn=self.table1, cn=self.column1, wn=word_name))
exist = self.c.fetchall()
if exist:
    do something

Aucun commentaire:

Enregistrer un commentaire