Skip to main content Accessibility help
×
Hostname: page-component-586b7cd67f-rcrh6 Total loading time: 0 Render date: 2024-11-22T10:27:25.717Z Has data issue: false hasContentIssue false

5 - Updates with variables

Published online by Cambridge University Press:  22 March 2010

Marianne Winslett
Affiliation:
University of Illinois, Urbana-Champaign
Get access

Summary

In traditional data manipulation languages, variables can occur in updates. Typically, these updates only cause changes in a single tuple; the variables are used as placeholders for don't-care values in that tuple. For example, in updating an employee's salary, variables can be used for all the irrelevant attributes of the employee record, and only the employee ID and the new salary specified in the update request.

To speed query processing in a relational theory, it may be desirable to restrict the body of the theory to ground formulas, as we did in the preceding chapters. In this case, to perform an update U containing variables, one must first find all the bindings σ of variables to data values such that the selection clause (φ)σ of U might be satisfied by some model of the theory. (In general, we expect all variables in ω to also appear in φ.) Each such set of bindings transforms U into a ground update (U)σ. The task of the update algorithm is then to perform all the ground updates (U)σ simultaneously, as described in Section 5.1. The cost of an update containing variables will be a function of the number of bindings σ for its variables, just as in ordinary relational databases.

If, on the other hand, the body of the relational theory is not restricted to ground formulas, updates with variables are very easy to perform, as shown in Section 5.2.

As usual, we confine our attention to insert requests: insert ω where φ.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1990

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Updates with variables
  • Marianne Winslett, University of Illinois, Urbana-Champaign
  • Book: Updating Logical Databases
  • Online publication: 22 March 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511663109.005
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Updates with variables
  • Marianne Winslett, University of Illinois, Urbana-Champaign
  • Book: Updating Logical Databases
  • Online publication: 22 March 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511663109.005
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Updates with variables
  • Marianne Winslett, University of Illinois, Urbana-Champaign
  • Book: Updating Logical Databases
  • Online publication: 22 March 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511663109.005
Available formats
×