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

5

8

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.

Resistant answered 23/12, 2008 at 2:24 Comment(1)
Should the title read "operations that can be applied repeatedly"? I would edit it for you but I'm not sure there is some other meaning of "replied" of which I am unaware. :-)Bi
M
15

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.

Maciemaciel answered 23/12, 2008 at 2:33 Comment(0)
B
11

IT's called idempotent

Battleship answered 23/12, 2008 at 2:29 Comment(2)
I think of idempotent to mean "doesn't change anything". As in GET vs. POST (at least ideally. :))Rockyrococo
Idempotent is defined to mean: f(f(x)) = f(x) for all x see the following for details: google.com/…Battleship
D
7

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.

Distinction answered 23/12, 2008 at 2:59 Comment(0)
R
1

Or perhaps deterministic.

Rockyrococo answered 23/12, 2008 at 2:31 Comment(4)
ouch you beat me to it for a tenth of a second. Let the downvote wars begin. =)Heterocyclic
I deleted my answer because it was exactly the same as yours. however that Kibbee guy (or girl) will beat you for verbosity.Heterocyclic
Yeah, I could have won the speed race, but I wanted to make my answer a little more complete. BTW, I'm a guy.Boreas
:D @Boreas could s/work/word/, but then your position would drop. A quamdary.Rockyrococo
B
1

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.

Boreas answered 23/12, 2008 at 2:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.