added materialization step before an insert and a scan/join of the same dataset.
diff --git a/asterix-app/src/test/resources/optimizerts/results/insert-and-scan-dataset.plan b/asterix-app/src/test/resources/optimizerts/results/insert-and-scan-dataset.plan
new file mode 100644
index 0000000..e11e2a8
--- /dev/null
+++ b/asterix-app/src/test/resources/optimizerts/results/insert-and-scan-dataset.plan
@@ -0,0 +1,15 @@
+-- COMMIT  |PARTITIONED|
+  -- STREAM_PROJECT  |PARTITIONED|
+    -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+      -- INSERT_DELETE  |PARTITIONED|
+        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+          -- MATERIALIZE  |PARTITIONED|
+            -- HASH_PARTITION_EXCHANGE [$$6]  |PARTITIONED|
+              -- ASSIGN  |PARTITIONED|
+                -- STREAM_PROJECT  |PARTITIONED|
+                  -- ASSIGN  |PARTITIONED|
+                    -- STREAM_PROJECT  |PARTITIONED|
+                      -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                        -- DATASOURCE_SCAN  |PARTITIONED|
+                          -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                            -- EMPTY_TUPLE_SOURCE  |PARTITIONED|