Database operation that can be applied repeatedly and produce the same results?

风格不统一 提交于 2019-12-08 16:27:14

问题


I'm drawing a blank, or as some would say, having a senior moment. I know there’s a formal definition and a name for the concept where a db operation (stored procedure) that runs in a database will yield the same results if run repeatedly.

It's something in the genre of the Mathematician’s reflexive, symmetric, transitive, etc.


回答1:


Do you mean "deterministic" - as in will always return the same result if called with the same input?

Or maybe "idempotent", which also means that calling the function again will have no further effect on the database.




回答2:


IT's called idempotent




回答3:


I think what you're looking for is Idempotent. Idempotence is a property that can apply to any sort of operation (not just databases). It means that doing the operation any number of times more than once is equivalent to doing it once. I.e. every subsequent operation after the first leaves the state unchanged.

For example, the play button on most DVD remotes is idempotent while playing a video because no matter how many times you push it, it keeps playing. However a power button on your remote is usually not idempotent, because it toggles the machine on and off each time. Idempotence is a nice property because you don't always have to know what state a system is in before engaging an operation to try to produce a given state.




回答4:


Or perhaps deterministic.




回答5:


I'm pretty sure you're thinking of the work "Deterministic". A function is deterministic if it returns the same answer for the same inputs all the time. A function is nondeterministic if it can return different answers for the same input.



来源:https://stackoverflow.com/questions/388007/database-operation-that-can-be-applied-repeatedly-and-produce-the-same-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!