Project

General

Profile

Bug #495

Morphology lookups are slow

Added by Luke Murphey almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
12/26/2012
Due date:
% Done:

100%

Associated revisions

Revision 287 (diff)
Added by Luke Murphey almost 12 years ago

Added indexing in order to improve lemma lookup performance. Closes #495.

Revision 287 (diff)
Added by Luke Murphey almost 12 years ago

Added indexing in order to improve lemma lookup performance. Closes #495.

Revision 279 (diff)
Added by Luke Murphey almost 12 years ago

Added indexing in order to improve lemma lookup performance. Closes #495.

History

#1 Updated by Luke Murphey almost 12 years ago

  • Status changed from New to In Progress

The lookups take about 3 to 3.5 seconds on my laptop.

#2 Updated by Luke Murphey almost 12 years ago

I made indexes and the performance improved dramatically. The lookup time decreased to about 15 ms with indexing. The indexes can be created with the following:

create index "reader_wordform_form" on "reader_wordform" ("form");
create index "reader_wordform_basic_form" on "reader_wordform" ("basic_form");

In Python, you can do the following:

from django.db import transaction
from django.db import connections
cursor = connections['library'].cursor()

cursor.execute("create index \"reader_wordform_form\" on \"reader_wordform\" (\"form\")")
transaction.commit_unless_managed()

cursor.execute("create index \"reader_wordform_basic_form\" on \"reader_wordform\" (\"basic_form\")")
transaction.commit_unless_managed()

#3 Updated by Luke Murphey almost 12 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

Applied in changeset r287.

Also available in: Atom PDF