Refreshing Projection
I created some projection for converting hash join to merge join between 2 tables.
When I ran explain then its still showing hash join only but after doing select refresh(); in explain its showing merge join.
Should I refresh everytime when I create a projection ?
Please tell me some rules and process after creating projection.
0
Comments
When you create a projection you must populate it first.
Here is short example:
Create a simple projection on a table ;
Try to run a query pointing to that projection:
- see that you get an error, this is becouse you have created the projection but there is nothing inside it."not up to date" or "not eligeble".
You must refresh your anchor table in order to populate the projection that depend on it.
In your case you probably create the projection without refresh and run the query pointing to the master projection/anchor table like i do here :
To make the projection availabe for use you need to refresh it , this way it will recognized by the optimizer.
see example;
You can see now that the optimizer is chosing the new created projection instead of the super projection.
So the conclusion is that you need to refresh it after you create it in order for it to be used. Also there are other things to be done as well like statistics and histograms.