Working with a large number of records in the session
📁 function, Flask microframework, AI, work, project
What is the correct way to work with a large number of records with SQLAlchemy?
I have two tables. The first 5 million records have the following types: question_id, view_count, counted. The second table contains the sum of view_count for each unique question_id. If we took into account the entry from the first table in the second, counted is set to true.
Right now it looks like this:
def update_most_viewed():
query = QuestionViewHistory.query.filter_by(counted=False).distinct()
question_count = query.count()
frame_size =
No answers yet.
Log in to leave an answer
Blogs
Best IDEs and Tools for TypeScript Development: Advanced Level
Why Random Strings Print "hello world"? Analysis and Java Best Practices 2025
How to Get the Selected Value from a Dropdown List in JavaScript: A Complete Guide
Initializing HashMap in Java: The Secret of the "Literal" Way