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

Use sensible limits #22

Open
sarg opened this issue Apr 9, 2024 · 4 comments
Open

Use sensible limits #22

sarg opened this issue Apr 9, 2024 · 4 comments

Comments

@sarg
Copy link
Contributor

sarg commented Apr 9, 2024

My browser history is ~400Mb:

sqlite> select count(1) from History;
1041185

It chokes emacs when typing first letter of the query, because the result list is huge. Could be avoided by limiting unconditionally to 100 entries, instead of doing that only for the empy input.

@agzam
Copy link
Owner

agzam commented Apr 9, 2024

The way to access the history db is to copy it fully and that takes time, if you don't need the latest, recent history all the time, try increasing browser-hist-cache-timeout. It will not copy the file all the time.

And then, if you need to include the latest results, you can call the command with universal argument, that will disregard the cached db file and copy it over again.

@sarg
Copy link
Contributor Author

sarg commented Apr 9, 2024

The problem is not in copying, but rather with feeding tens of thousands rows to completing-read.

@agzam
Copy link
Owner

agzam commented Apr 9, 2024

When was the last time you've updated the package? #15 added some improvements.

@sarg
Copy link
Contributor Author

sarg commented Apr 9, 2024

I use the latest. The fix I've implemented in my checkout is to force LIMIT 100 unconditionally:

-                   rest (and emptyp " LIMIT 100")))) ;No match, just return history
+                   rest " LIMIT 100"))) ;No match, just return history

Otherwise typing e.g. reddit makes emacs freeze for a minute until showing that the result set has 14k elements.

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

2 participants