Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is there a way to save the last X searches so that if they are searched again it is faster the next time?#522

Unanswered
tgkuus asked this question inQ&A
Discussion options

I could be mistaken but it seems tinydb remembers the last search or maybe returns the same result if nothing about the query or database has changed.

I was wondering if there was a way to set the number of searches "remembered". Between 10 - 20 would speed up my application very significantly as it is the same 10-20 searches that happen in random order in a relatively large database (2000 docs or so). I realize I can save results, maybe in another table or in memory or something, however I wanted to know if there was a built in feature. Even more ideally if there was a setting that let me put in an arbitrary value for searches remembered.

You must be logged in to vote

Replies: 1 comment

Comment options

Hey! I think you're talking about the query cache feature. The documentation describeshow to adjust the size of the query cache:

TinyDB caches query result for performance. That way re-running a query won’t have to read the data from the storage as long as the database hasn’t been modified. You can optimize the query cache size by passing the cache_size to the table(...) function:

>>> table = db.table('table_name', cache_size=30)

Does that help you?

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@tgkuus@msiemens

[8]ページ先頭

©2009-2025 Movatter.jp