-
Notifications
You must be signed in to change notification settings - Fork 9
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
What about Logical decoding ? #1
Comments
Yes, it's definitely possible but it requires Postgres 9.4. Although it may provide a slight performance improvement, manual triggers would not change: it would simply work like In order to automate what is currently "manual" triggers. I have started exploring ways to parse the |
And if you're wondering if it's possible to update queries without repeatedly executing the query, see the abandoned It turns out that doing all that work in Javascript blocks the event loop significantly on higher loads, resulting in faster operation by offloading the work to Postgres. |
Is Postgres 9.4 too big of a requirement ? I think a possible way would be to first implement it using Logical Decoding, then add the fallback for older versions of postgres... |
If one uses logical decoding, does it mean the computation would need to happen in the application process? Can it be done in the postgres process with stored procedures? |
Hey Slava, Thinking about it now though, if triggers were abandoned for only reading from the write-ahead log, there would have to be constant polling for new changes. In a high-traffic environment, this might result in fewer transmissions between the pg server and the app server but in low-traffic situations, the opposite. Unless an extension to postgres is written so that asynchronous actions can be performed, the diffing of result sets is best to be initiated from the app server in order to provide a throttling mechanism. Not sure if that helps, maybe you can elaborate more? |
I guess, I meant something different. By "computation", I meant "figuring out how to incrementally recompute the query" or "re-poll the query and diff the result". |
Oh okay. Yeah that would need to take place in the app server or a custom postgres extension that uses a Background Worker. As far as I know, there's no way to place a "trigger" on a write-ahead log entry using logical decoding. |
It looks like pg-live-select is currently working with manual triggers. This is a lot of work and hard to do right.
Is the live-select functionality achievable with the Logical Decoding feature of postgres (http://www.postgresql.org/docs/9.4/static/logicaldecoding.html) ?
I'm curious about whether Logical Decoding has been thought about. And if yes, what are the problems with it ?
Discussion on hacher news here: https://news.ycombinator.com/item?id=9387988
The text was updated successfully, but these errors were encountered: