guillemusG
Convex Community4mo ago
1 reply
guillemus

full text search is very slow (on dev env)

I'm very surprised by how bad does text search perform on convex. Suppose we have this doc schema:

const issueTitles = defineTable({
    repoId: v.id('repos'),
    title: v.string(),
})
    .searchIndex('search_by_title', {
        searchField: 'title',
        filterFields: ['repoId'],
    })
    .index('by_repo_id', ['repoId'])


When I search by title across 3k rows, the average search takes around 450ms to complete. The titles haven't that much text. The titles don't have much text in them, if I fetch all titles into a text file the total size is about 200kb.

I would expect the total query time to be less than 50ms for such few rows.

For the following search queries I get the following times on the logs page

"Aaron" -> 66ms, 0 results.
"feature" -> 383ms, 99 results
"web app" -> 633ms, 154 results

I understand that text search isn't the primary focus of convex, but this is too slow for such few rows isn't it?

For context!

- This is running on the development instance. I haven't yet tried on the production instance (bit of work to set it up).
- I'm not on convex paid plan. Should I expect much better search performance there? Should I test search performance there?
Was this page helpful?