<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>http://d2.reldb.org/index.php?action=history&amp;feed=atom&amp;title=Update_through_views%3A_rewrites</id>
		<title>Update through views: rewrites - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://d2.reldb.org/index.php?action=history&amp;feed=atom&amp;title=Update_through_views%3A_rewrites"/>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;action=history"/>
		<updated>2026-05-06T15:14:32Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=110&amp;oldid=prev</id>
		<title>AntC: /* Semantics: effect of update operations */</title>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=110&amp;oldid=prev"/>
				<updated>2017-02-07T11:00:31Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Semantics: effect of update operations&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en-GB&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:00, 7 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot; &gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| DELETE &amp;quot;re&amp;quot; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;;&amp;#160; || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| DELETE &amp;quot;re&amp;quot; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;;&amp;#160; || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| UPDATE &amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&amp;#160; || &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)) UNION &amp;#039;&amp;#039;Upd&amp;#039;&amp;#039;((&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;), &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| UPDATE &amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&amp;#160; || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)) UNION &amp;#039;&amp;#039;Upd&amp;#039;&amp;#039;((&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;), &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;re&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160; // assignment&amp;#160;  || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;v&amp;#039;&amp;#039;,&amp;#160; == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;v&amp;#039;&amp;#039;)) UNION (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;re&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;re&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160; // assignment&amp;#160;  || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;v&amp;#039;&amp;#039;,&amp;#160; == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;v&amp;#039;&amp;#039;)) UNION (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;re&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l67&quot; &gt;Line 67:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 67:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! style=&amp;quot;width: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;35&lt;/del&gt;%; &amp;quot; |Operation&amp;#160; &amp;#160; &amp;#160; &amp;#160;  !! ==&amp;gt; equivalent operation&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! style=&amp;quot;width: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;40&lt;/ins&gt;%; &amp;quot; | Operation&amp;#160; &amp;#160; &amp;#160; &amp;#160;  !! ==&amp;gt; equivalent operation&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| INSERT &amp;#039;&amp;#039;re&amp;#039;&amp;#039;&amp;#160; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160; &amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;re&amp;#039;&amp;#039; := &amp;#039;&amp;#039;re&amp;#039;&amp;#039; UNION &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| INSERT &amp;#039;&amp;#039;re&amp;#039;&amp;#039;&amp;#160; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160; &amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;re&amp;#039;&amp;#039; := &amp;#039;&amp;#039;re&amp;#039;&amp;#039; UNION &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AntC</name></author>	</entry>

	<entry>
		<id>http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=109&amp;oldid=prev</id>
		<title>AntC: /* Preliminaries/general approach */</title>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=109&amp;oldid=prev"/>
				<updated>2017-02-07T10:55:41Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Preliminaries/general approach&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en-GB&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:55, 7 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot; &gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: 40%; &amp;quot; | (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) UNION (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; OR &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: 40%; &amp;quot; | (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) UNION (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;|| ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; OR &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;R&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE NOT &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;R&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE NOT &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AntC</name></author>	</entry>

	<entry>
		<id>http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=108&amp;oldid=prev</id>
		<title>AntC: /* Preliminaries/general approach */</title>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=108&amp;oldid=prev"/>
				<updated>2017-02-07T10:50:27Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Preliminaries/general approach&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en-GB&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:50, 7 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* UPDATE (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* UPDATE (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Is only a smidgeon away from:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Is only a smidgeon away from:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* UPDATE &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; AND &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) : assigns;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* UPDATE &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; AND &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) : &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;assigns&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#039;&amp;#039;&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So that is now targetting a base variable.&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;So that is now targetting a base variable.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot; &gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;35&lt;/del&gt;%; &amp;quot; | (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) UNION (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; OR &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;40&lt;/ins&gt;%; &amp;quot; | (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) UNION (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; OR &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;R&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE NOT &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| &amp;#039;&amp;#039;R&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&amp;#160; || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE NOT &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot; &gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;35&lt;/del&gt;%; &amp;quot; | INSERT (&amp;#039;&amp;#039;R1&amp;#039;&amp;#039; JOIN &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;) &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160;  || ==&amp;gt; INSERT &amp;#039;&amp;#039;R1&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R1&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; INSERT &amp;#039;&amp;#039;R2&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;});&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;width: &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;40&lt;/ins&gt;%; &amp;quot; | INSERT (&amp;#039;&amp;#039;R1&amp;#039;&amp;#039; JOIN &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;) &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&amp;#160;  || ==&amp;gt; INSERT &amp;#039;&amp;#039;R1&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R1&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; INSERT &amp;#039;&amp;#039;R2&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AntC</name></author>	</entry>

	<entry>
		<id>http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=107&amp;oldid=prev</id>
		<title>AntC: /* Sub-terms that are not updatable-through */</title>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=107&amp;oldid=prev"/>
				<updated>2017-02-07T10:46:12Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Sub-terms that are not updatable-through&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en-GB&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:46, 7 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l81&quot; &gt;Line 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 81:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sub-terms that are not updatable-through ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Sub-terms that are not updatable-through ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Where a sub-term is a literal/constant, it is not updatable-through. (In effect it is subject to a constraint that it always be that value, so falls under Prescription 2 &amp;quot;Golden Rule&amp;quot;.) Rewrites can take advantage of that constraint to disambiguate rewrites. For example&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[to do]&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[to do]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AntC</name></author>	</entry>

	<entry>
		<id>http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=104&amp;oldid=prev</id>
		<title>AntC: Fully worked out rewrite rules (in progress/to do)</title>
		<link rel="alternate" type="text/html" href="http://d2.reldb.org/index.php?title=Update_through_views:_rewrites&amp;diff=104&amp;oldid=prev"/>
				<updated>2017-02-07T10:31:45Z</updated>
		
		<summary type="html">&lt;p&gt;Fully worked out rewrite rules (in progress/to do)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[todo: currently includes all examples from discussions; add more rewrites for full coverage; precisely specify the rewrite rules and qualifying conditions]&lt;br /&gt;
&lt;br /&gt;
== Preliminaries/general approach ==&lt;br /&gt;
&lt;br /&gt;
Assume a variant of &amp;#039;&amp;#039;&amp;#039;Tutorial D&amp;#039;&amp;#039;&amp;#039; in which targets for update can be relational expressions, not merely relvar names. Then a view name (virtual relvar) is to be a shorthand for its defining expression. We&amp;#039;re already doing that in read contexts. Do so also  in update target contexts.&lt;br /&gt;
&lt;br /&gt;
I.e. if there&amp;#039;s a virtual defined in the form&lt;br /&gt;
* VAR &amp;#039;&amp;#039;V&amp;#039;&amp;#039; VIRTUAL (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)&lt;br /&gt;
: as a target for update&lt;br /&gt;
* UPDATE &amp;#039;&amp;#039;V&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&lt;br /&gt;
expand to the syntax for update &amp;#039;targets&amp;#039; as relational expressions:&lt;br /&gt;
* UPDATE (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;&lt;br /&gt;
: Is only a smidgeon away from:&lt;br /&gt;
* UPDATE &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; AND &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) : assigns;&lt;br /&gt;
&lt;br /&gt;
So that is now targetting a base variable.&lt;br /&gt;
&lt;br /&gt;
A virtual&amp;#039;s defining expression might itself refer to virtuals. Recursively substitute their defining expressions, until the target expression consists only of base relvar names, literals/constants and relational operators.&lt;br /&gt;
&lt;br /&gt;
Where a given base relvar appears more than once in the target expression, refactor the expression (if possible) so that it appears only once. For example:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 35%; &amp;quot; | (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;) UNION (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;) || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE (&amp;#039;&amp;#039;p&amp;#039;&amp;#039; OR &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;R&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;q&amp;#039;&amp;#039;)  || ==&amp;gt; &amp;#039;&amp;#039;R&amp;#039;&amp;#039; WHERE NOT &amp;#039;&amp;#039;q&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
: That is, refactor using the equational equivalences used typically for optimising query plans. These must be information-preserving.&lt;br /&gt;
: If a multiply-occuring base relvar cannot be refactored to a single occurence, that is of itself survivable, but it might have the effect that some &amp;#039;&amp;#039;relexpr&amp;#039;&amp;#039; is not updatable-through, whereas a suitably refactored expression would be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If there&amp;#039;s an IND between two relations &amp;#039;&amp;#039;R1, R2&amp;#039;&amp;#039;, it doesn&amp;#039;t seem a big stretch to put them together as target in a single update statement, rather than two. (That is, put them together as a shorthand for the Multiple Assignment. Figuring out the separate updates is something a dbms could do mechanically; why impose that load on the programmer?)&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;width: 35%; &amp;quot; | INSERT (&amp;#039;&amp;#039;R1&amp;#039;&amp;#039; JOIN &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;) &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;   || ==&amp;gt; INSERT &amp;#039;&amp;#039;R1&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R1&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; INSERT &amp;#039;&amp;#039;R2&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;R2&amp;#039;&amp;#039;});&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In various examples I&amp;#039;ve identified the sort of criteria that can be considered:&lt;br /&gt;
*	keys and cardinality of joins&lt;br /&gt;
*	constraints (particularly INDs)&lt;br /&gt;
*	projections that make attributes &amp;#039;inaccessible&amp;#039; from the view&lt;br /&gt;
*	the form of the update request, Prescription 2.&lt;br /&gt;
	(for example DELETE ... WHERE ... could succeed whereas DELETE ... v might not.)&lt;br /&gt;
*	in general anything that can be examined at compile time, Prescription 3.&lt;br /&gt;
&lt;br /&gt;
== Semantics: effect of update operations ==&lt;br /&gt;
&lt;br /&gt;
For definiteness, this is the specified effect for the update operations (Prescription 2), in style of RM Prescription 21&lt;br /&gt;
&amp;lt;blockquote&amp;gt;After  assignment  of  v  to  V  (the  “target variable”),  the  equality  comparison  V  =  v  shall  evaluate  to  TRUE.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: These are entirely standard; stated here to show equivalences of update operations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! style=&amp;quot;width: 35%; &amp;quot; | Operation (see [[#Notation]]) !! After update this equation shall hold true (where &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; is the &amp;#039;after&amp;#039; value)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|  INSERT &amp;#039;&amp;#039;re&amp;#039;&amp;#039;  &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;    ||  &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;re&amp;#039;&amp;#039; UNION &amp;#039;&amp;#039;v&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| DELETE &amp;quot;re&amp;quot;  &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;   ||  &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS&amp;#039;&amp;#039; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| DELETE &amp;quot;re&amp;quot; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;;  || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| UPDATE &amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039; : &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;;  ||  &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;)) UNION &amp;#039;&amp;#039;Upd&amp;#039;&amp;#039;((&amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE &amp;#039;&amp;#039;p&amp;#039;&amp;#039;), &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;re&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;  // assignment   || &amp;#039;&amp;#039;re&amp;#039; &amp;#039;&amp;#039; == &amp;#039;&amp;#039;v&amp;#039;&amp;#039;,  == (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;v&amp;#039;&amp;#039;)) UNION (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;re&amp;#039;&amp;#039;)&lt;br /&gt;
|}       &lt;br /&gt;
&lt;br /&gt;
The rewrites may take advantage of the following equivalences, especially so that some operation be supported which would not otherwise be updatable-through.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! style=&amp;quot;width: 35%; &amp;quot; |Operation         !! ==&amp;gt; equivalent operation&lt;br /&gt;
|-&lt;br /&gt;
| INSERT &amp;#039;&amp;#039;re&amp;#039;&amp;#039;  &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;    || ==&amp;gt; &amp;#039;&amp;#039;re&amp;#039;&amp;#039; := &amp;#039;&amp;#039;re&amp;#039;&amp;#039; UNION &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&lt;br /&gt;
|-&lt;br /&gt;
| DELETE &amp;#039;&amp;#039;re&amp;#039;&amp;#039;  &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;   || ==&amp;gt;  &amp;#039;&amp;#039;re&amp;#039;&amp;#039; := &amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;&lt;br /&gt;
|-&lt;br /&gt;
| DELETE &amp;#039;&amp;#039;re&amp;#039;&amp;#039;  &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;   || ==&amp;gt; DELETE &amp;#039;&amp;#039;re&amp;#039;&amp;#039; WHERE (rel{tup{*}} MATCHING &amp;#039;&amp;#039;v&amp;#039;&amp;#039;);&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;re&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;v&amp;#039;&amp;#039;;          || ==&amp;gt; DELETE &amp;#039;&amp;#039;re&amp;#039;&amp;#039; (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;v&amp;#039;&amp;#039;) &amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; INSERT &amp;#039;&amp;#039;re&amp;#039;&amp;#039; (&amp;#039;&amp;#039;v&amp;#039;&amp;#039; MINUS &amp;#039;&amp;#039;re&amp;#039;&amp;#039;);&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
: In particular, &amp;#039;&amp;#039;&amp;#039;:=&amp;#039;&amp;#039;&amp;#039; assignment is only supported on condition that both DELETE and INSERT are supported, so usually is rewritten as such.&lt;br /&gt;
&lt;br /&gt;
== Sub-terms that are not updatable-through ==&lt;br /&gt;
&lt;br /&gt;
[to do]&lt;br /&gt;
&lt;br /&gt;
== Notation ==&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| style=&amp;quot;width: 25%; &amp;quot; | &amp;#039;&amp;#039;relexpr, re, re&amp;#039;, re1, re2, ...&amp;#039;&amp;#039;  || relational expressions&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;R, R&amp;#039;, R1, R2, ...&amp;#039;&amp;#039;     || relvar names (i.e. bases)&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;p, q, p1, q1, ...&amp;#039;&amp;#039;   || predicate expressions (booleans) for WHERE clauses&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;    || attribute assignment lists in UPDATE or EXTEND&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;Upd&amp;#039;&amp;#039;(&amp;#039;&amp;#039;relexpr&amp;#039;&amp;#039;, &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039;)   || a function that applies &amp;#039;&amp;#039;assigns&amp;#039;&amp;#039; to the relation value of &amp;#039;&amp;#039;relexpr&amp;#039;&amp;#039;, yielding a relation value&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| ==&amp;gt; || rewrite rule: transform the left operation to the right&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;lt;==&amp;gt;   || two-way rewrite: transform in either direction&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| rel{tup{*}} || a singleton relation formed from the &amp;#039;current&amp;#039; tuple of some enclosing relation expression&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;relop&amp;#039;&amp;#039;   || an arbitrary relational operator (infix), including projection considered as an operator&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;relexpr&amp;#039;&amp;#039; {attribs of &amp;#039;&amp;#039;re2&amp;#039;&amp;#039;}   || a projection of &amp;#039;&amp;#039;relexpr&amp;#039;&amp;#039; on the attributes of &amp;#039;&amp;#039;re2&amp;#039;&amp;#039;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
| &amp;#039;&amp;#039;upd1&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;upd2&amp;#039;&amp;#039;;   || Note the &amp;#039;&amp;#039;&amp;#039;,&amp;#039;&amp;#039;&amp;#039; comma, not semicolon separating two update statements. This is standard &amp;#039;&amp;#039;&amp;#039;Tutorial D&amp;#039;&amp;#039;&amp;#039; Multiple Update (aka Multiple Assignment). Typically the rewrites for a target with more than one base relvar will be set of Multiple Updates (separated by commas), one for each relvar. The rewrites will &amp;#039;walk&amp;#039; down the target&amp;#039;s expression tree, generating an update for each sub-term until it gets to the base relvars.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== JOINs ==&lt;br /&gt;
A)	INSERT through 1:many JOIN with IND&lt;br /&gt;
	Supported for update.&lt;br /&gt;
*	INSERT (R1 JOIN R2) v ;&lt;br /&gt;
:	==&amp;gt; INSERT R1 (v{attribs of R1}), INSERT R2 (v{attribs of R2});&lt;br /&gt;
&lt;br /&gt;
B)	INSERT through 1:many JOIN without IND&lt;br /&gt;
	Not supported: an INSERT on the 1 side could MATCH tuples already in the many side,&lt;br /&gt;
	that would thereby &amp;#039;appear&amp;#039; in the result; so breaking Assignment Principle.&lt;br /&gt;
&lt;br /&gt;
C)	DELETE through 1:many JOIN (with or without IND)&lt;br /&gt;
	Supported: delete from the many side only.&lt;br /&gt;
*	DELETE (R1 JOIN R2) v;           // R2 is the many side&lt;br /&gt;
:	==&amp;gt; DELETE R2 ( (R2 MATCHING R1) MATCHING v);&lt;br /&gt;
	Deleting from the 1 side might &amp;#039;unMATCH&amp;#039; non-targetted tuples on the many side,&lt;br /&gt;
	that would thereby &amp;#039;disappear&amp;#039; from the result.&lt;br /&gt;
	If no such tuples, we might DELETE the 1 side, but that&amp;#039;s not essential.&lt;br /&gt;
&lt;br /&gt;
D)	DELETE through 1:1 JOIN with two-way IND (i.e. EQD)&lt;br /&gt;
	Supported: delete from both sides.&lt;br /&gt;
*	DELETE (R1 JOIN R2) v; &lt;br /&gt;
: ==&amp;gt; DELETE R1 ( (R1 MATCHING R2) MATCHING v),     // Multiple Update&lt;br /&gt;
:: DELETE R2 ( (R2 MATCHING R1) MATCHING v);&lt;br /&gt;
&lt;br /&gt;
E)	DELETE through 1:1 JOIN with a single IND&lt;br /&gt;
	Supported: delete from the dependent (subset) side only.&lt;br /&gt;
*	DELETE (R1 JOIN R2) v;           // R2 is the subset side&lt;br /&gt;
:	==&amp;gt; DELETE R2 ( (R2 MATCHING R1) MATCHING v);&lt;br /&gt;
&lt;br /&gt;
F)	DELETE through 1:1 join without IND&lt;br /&gt;
	Not supported: could be achieved by deleting from either side only or both.&lt;br /&gt;
	Then neither tuple DELETE is essential.&lt;br /&gt;
&lt;br /&gt;
: Assign through 1:many JOIN with IND&lt;br /&gt;
*	(R1 JOIN R2) := v;&lt;br /&gt;
	==&amp;gt; DELETE (R1 JOIN R2) ((R1 JOIN R2) MINUS v), INSERT (R1 JOIN R2) (v MINUS (R1 JOIN R2));&lt;br /&gt;
&lt;br /&gt;
== Restrictions ==&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;&amp;#039;Appendix A&amp;#039;&amp;#039;&amp;#039; approach is that Restrictions are Joins. And yet joins that arise from restrictions are typically not joins of bases. Examples:&lt;br /&gt;
&lt;br /&gt;
* (R WHERE X = 1) &amp;lt;==&amp;gt; R JOIN REL{TUP{X 1}}&lt;br /&gt;
: REL{TUP{X 1}} is not a base. In fact it&amp;#039;s a constant, so not updatable at all.&lt;br /&gt;
&lt;br /&gt;
* (R WHERE X &amp;gt; Y) &amp;lt;==&amp;gt; R JOIN REL{{{x, y} | x IN dom(X), y IN dom(Y), x &amp;gt; y}}&lt;br /&gt;
: That REL{ } is not a base. I&amp;#039;ve defined it using set builder notation. In fact it&amp;#039;s a constant, so not updatable at all.&lt;br /&gt;
&lt;br /&gt;
* In case of (R WHERE &amp;lt;subselect on R2&amp;gt;) we need to consider more carefully. Typically R2 has attributes that don&amp;#039;t appear in R, so any update would amount to update-through-projection. Which is a different kettle of fish to update-through-join.&lt;br /&gt;
&lt;br /&gt;
So we need update-through-restriction, which is usually regarded as non-controversial:&lt;br /&gt;
* INSERT (R WHERE p) v; ==&amp;gt; INSERT R (v WHERE p);&lt;br /&gt;
* DELETE (R WHERE p) v; ==&amp;gt; DELETE R (v WHERE p);&lt;br /&gt;
* DELETE (R WHERE p) WHERE q; ==&amp;gt; DELETE R WHERE (p AND q)&lt;br /&gt;
* Therefore assign(:=) is supported, being a combo of DELETE, INSERT.&lt;br /&gt;
* UPDATE also supported, being a combo of DELETE, INSERT.&lt;br /&gt;
: A tad tricky because the updated tuples might fail the restriction.&lt;br /&gt;
: And that attempt should be rejected as failing prescription 2 &amp;quot;Assignment P&amp;quot;. aka SQL&amp;#039;s WITH CHECK OPTION, approximately.&lt;br /&gt;
: Assume I have a function Upd(rel, assigns) that applies assigns to rel:&lt;br /&gt;
: UPDATE (R WHERE p) WHERE q : assigns; ==&amp;gt;&lt;br /&gt;
: IF IS_EMPTY(Upd(R WHERE (p AND q), assigns) WHERE NOT p)&lt;br /&gt;
: THEN UPDATE R WHERE (p AND q) : assigns ; &lt;br /&gt;
: ELSE Fail ; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Projections ==&lt;br /&gt;
&lt;br /&gt;
Projections are awkward for updating through. Push projections towards the leaves as far as possible, for example:&lt;br /&gt;
* For [NOT] MATCHING, which needs a projection and JOIN&lt;br /&gt;
: &amp;#039;&amp;#039;&amp;#039;Appendix A&amp;#039;&amp;#039;&amp;#039; gives: &amp;#039;&amp;#039;re1&amp;#039;&amp;#039; MATCHING &amp;#039;&amp;#039;re2&amp;#039;&amp;#039; ==&amp;gt; (&amp;#039;&amp;#039;re1&amp;#039;&amp;#039; JOIN &amp;#039;&amp;#039;re2&amp;#039;&amp;#039;) { attribs of &amp;#039;&amp;#039;re1&amp;#039;&amp;#039; }&lt;br /&gt;
: Instead: &amp;#039;&amp;#039;re1&amp;#039;&amp;#039; MATCHING &amp;#039;&amp;#039;re2&amp;#039;&amp;#039; ==&amp;gt; &amp;#039;&amp;#039;re1&amp;#039;&amp;#039; JOIN (&amp;#039;&amp;#039;re2&amp;#039;&amp;#039; { attribs in common } )&lt;br /&gt;
&lt;br /&gt;
* For projections that are really implementing RENAME, change to RENAME&lt;br /&gt;
: (EXTEND &amp;#039;&amp;#039;re&amp;#039;&amp;#039; : { B := A }) {ALL BUT A} ==&amp;gt; (&amp;#039;&amp;#039;re&amp;#039;&amp;#039; RENAME A AS B) &lt;br /&gt;
&lt;br /&gt;
* For no-op projections (i.e. is projecting all attributes), all updates are supported.&lt;br /&gt;
: Rewrite &amp;#039;&amp;#039;updop&amp;#039;&amp;#039; (&amp;#039;&amp;#039;re&amp;#039;&amp;#039;{ ... }) ...; ==&amp;gt; &amp;#039;&amp;#039;updop&amp;#039;&amp;#039; &amp;#039;&amp;#039;re&amp;#039;&amp;#039; ...;&lt;br /&gt;
&lt;br /&gt;
G)	DELETE through projection&lt;br /&gt;
	Supported (whether or not the projection is key-preserving.)&lt;br /&gt;
	DELETE (R{ ... }) WHERE p; ==&amp;gt; DELETE R WHERE p;&lt;br /&gt;
	DELETE (R{ ... }) v; ==&amp;gt; DELETE R (R MATCHING v);&lt;br /&gt;
	We must DELETE exactly those base tuples to achieve the DELETE of the proj.&lt;br /&gt;
	We can&amp;#039;t DELETE too many, by those rewrites.&lt;br /&gt;
&lt;br /&gt;
H)	INSERT through projection&lt;br /&gt;
	Not valid. (No surprise.) Therefore&lt;br /&gt;
&lt;br /&gt;
I)	assign (:=) through projection&lt;br /&gt;
	Not valid.&lt;br /&gt;
&lt;br /&gt;
J)	UPDATE through projection&lt;br /&gt;
	Valid providing the projection is key-preserving (i.e. at least one key).&lt;br /&gt;
	UPDATE (R{ ... }) WHERE p : assigns; ==&amp;gt; UPDATE R WHERE p : assigns;&lt;br /&gt;
	Note: the assigns could be changing the key.&lt;br /&gt;
&lt;br /&gt;
	Valid even if the projection is not key-preserving,&lt;br /&gt;
	providing the assigns are not changing attribs in the based-on&amp;#039;s key&lt;br /&gt;
	(for at least one key).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[For ref: Dave&amp;#039;s suggested &amp;#039;template&amp;#039; for spcifying rewrites]&lt;br /&gt;
&lt;br /&gt;
2. Update through JOIN&lt;br /&gt;
&lt;br /&gt;
Given r1 JOIN r2 where r1 and r2 are arbitrary relations.&lt;br /&gt;
&lt;br /&gt;
a. Rewrite &lt;br /&gt;
	UPDATE r1 JOIN r2: {p := q} &lt;br /&gt;
as &lt;br /&gt;
	UPDATE ….&lt;br /&gt;
&lt;br /&gt;
b. Rewrite&lt;br /&gt;
	INSERT (r1 JOIN r2) v&lt;br /&gt;
as&lt;br /&gt;
	INSERT ….&lt;br /&gt;
&lt;br /&gt;
c. Rewrite&lt;br /&gt;
	DELETE r1 JOIN r2 WHERE p&lt;br /&gt;
as&lt;br /&gt;
	DELETE ...&lt;br /&gt;
&lt;br /&gt;
d. Rewrite&lt;br /&gt;
	(r1 JOIN r2) := v&lt;br /&gt;
as&lt;br /&gt;
	...&lt;br /&gt;
&lt;br /&gt;
Or: Not supported.&lt;/div&gt;</summary>
		<author><name>AntC</name></author>	</entry>

	</feed>