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.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
  • 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. :-) – Onorio Catenacci Dec 23 '08 at 02:33

5 Answers5

14

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.

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
11

IT's called idempotent

Scott Wisniewski
  • 24,561
  • 8
  • 60
  • 89
  • I think of idempotent to mean "doesn't change anything". As in GET vs. POST (at least ideally. :)) – dkretz Dec 23 '08 at 02:37
  • 1
    Idempotent is defined to mean: f(f(x)) = f(x) for all x see the following for details: http://www.google.com/search?rlz=1C1GGLS_en-USUS298US304&sourceid=chrome&ie=UTF-8&q=define:idempotent – Scott Wisniewski Dec 23 '08 at 03:30
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.

Dave L.
  • 43,907
  • 11
  • 63
  • 62
1

Or perhaps deterministic.

dkretz
  • 37,399
  • 13
  • 80
  • 138
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.

Kibbee
  • 65,369
  • 27
  • 142
  • 182