Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is there no doc_id index on the doclist table? #200

Open
jasonlfunk opened this issue Jan 9, 2020 · 2 comments
Open

Why is there no doc_id index on the doclist table? #200

jasonlfunk opened this issue Jan 9, 2020 · 2 comments

Comments

@jasonlfunk
Copy link

Hello -

Because of a bug in Laravel Scout (laravel/scout#331) I was sometimes seeing model creation times of 8-10 seconds. My models are not searchable when they are first created (they are just pending) but since Scout doesn't know they aren't in the index yet, it has to look for them and then delete them. (Though, if it finds 0 documents - it doesn't really need to do the delete query at all -- but that's a separate bug.)

I have a pretty large index (380M) and these searches were taking unacceptably long. I manually added and index to the doc_id column and that made the app speedy again. However, I don't know all the ramifications of this. Is there a specific reason that the index is not created by default? I do notice that my database file grew from 380M to 510M. Perhaps this is the only reason it's not included by default? But, in my case, the application was borderline unusable without it.

@nticaric
Copy link
Contributor

nticaric commented Jan 9, 2020

I think you're right, there should be an index. Cannot think of any other reason than file size and speed of index creation. But since storage is cheap, it's better to have performance then small size.

Would you be so kind and create a pull request for this?

@ConnectGrid
Copy link

This doc_id index has been included in the latest release. This issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants