-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
improve content-fetch #4221
improve content-fetch #4221
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
… requests per hour
…ble for counting query
Squawk Report✅ 0 violations across 1 file(s)
|
@jacksonh I created an index on columns |
@@ -25,7 +25,7 @@ export const libraryItemRepository = appDataSource | |||
.andWhere('md5(original_url) = md5(:url)', { url }) | |||
|
|||
if (forUpdate) { | |||
qb.setLock('pessimistic_write') | |||
qb.setLock('pessimistic_read') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced pessimistic_write
with pessimistic_read
lock strategy so it will prevent other transactions from modifying the data while it is being read but allows other transactions to read the data concurrently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually a pretty big performance improvement too i think as the COUNT calls were adding up.
LGTM |
Some improvement on content-fetch:
created_at
instead ofsaved_at
assaved_at
can be manually input