arbalada
arbalada2d ago

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'])
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?
1 Reply
Convex Bot
Convex Bot2d ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?