Skip to content

Redundant sequential SQLite file opens and identical SELECT queries #738

Open

Description

@ashb155

Terms

Behavior

Caution

When opening the conjugation table for a verb, ConjugationSelectionScreen sequentially opens and closes the SQLite database file from disk multiple times in a row (once for every single conjugation form in the table).

On each iteration, getTheValueForTheConjugateWord executes SELECT * FROM verbs WHERE infinitive = ?, loads the full row into memory, reads only a single column, and discards the rest of the retrieved row before closing the database. Re-opening the database file and re-running the exact same query multiple times sequentially causes unnecessary disk I/O overhead, GC churn, and performance issues.

Because all conjugation forms for a verb are already stored within a single row in the SQLite table, the entire table can be populated in one single query and one database open instead of multiple sequential disk opens.

Image

Proposed Solution

Open the SQLite database once. Query the verb row once with SELECT * FROM verbs WHERE infinitive = ?. Resolve all conjugation forms in-memory from the returned row data. Close the database once.

Device type

Samsung S23

Versions

No response

CC @andrewtavis

Activity

  1. added theissue type on Oct 19, 2026
  2. self-assigned this
    on Oct 19, 2026
  3. andrewtavis commented on Oct 20, 2026

    @andrewtavis
    Member

    Thanks @ashb155! I assume that this is going to be fixed by #715, which closes #714 and #598. We just need the new contracts to be finalized in scribe-org/Scribe-Server#114 :)

  4. ashb155 commented on Oct 20, 2026

    @ashb155
    CollaboratorAuthor

    @andrewtavis I had a look at #715, but this is actually a separate client-side bottleneck. While #715 updates the data contracts, the screen still queries the database repeatedly in a loop for each individual form instead of fetching everything in one go.

    we might want to look into optimizing this as well.

  5. andrewtavis commented on Oct 20, 2026

    @andrewtavis
    Member

    Ok, sounds good, @ashb155! Let's wait till #715 is in and then start here :)

  6. ashb155 commented on Oct 20, 2026

    @ashb155
    CollaboratorAuthor

    have blocked the issue for now @andrewtavis , we can take it up once #715 is finalized!

  7. andrewtavis commented on Oct 20, 2026

    @andrewtavis
    Member

    Nice @ashb155! I added the caution note to the issue text with a - to render the issue name and status so it's easy to keep track of 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

blockedAnother issue is blockinghelp wantedExtra attention is needed

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions