Skip to main content

Projections and refresh()


njvijay
If projections are updated(or refreshed) automatically during the load then why would I need to use refresh() function? Can somebody explain me exact scenario where I do need to call refresh() or start_refresh() and where I don't need to call refresh()?

5 replies

Forum|alt.badge.img+2
  • Participating Frequently
  • August 23, 2013
When you create a new projection, it is not automatically popualated with data. So in order to pouplate it with data
we use REFRESH() & START_REFRESH() manualy. If you use DBD for projection design, refreshing of projections is done automatically.
 
REFRESH - Performs a synchronous, optionally-targeted refresh of a specified table's projections.
Unlike START_REFRESH(), which runs in the background, REFRESH() runs in the foreground of the caller's session.

njvijay
  • Author
  • Participating Frequently
  • August 24, 2013
Pravesh, when super projection is created, I don't refresh it. I do believe super projection is an exception. right?

Navin_C
Forum|alt.badge.img+2
  • Participating Frequently
  • August 26, 2013
Hello Vijay, The scenario where we need to refresh Projections manually sometimes is when we create manual projections for any query and you want the query to use the same projections meant for it ( .i.e. newly created projection) .

njvijay
  • Author
  • Participating Frequently
  • August 27, 2013
I noticed one thing. If a table is loaded when I create a projection manually, it requires refresh(). If the table is empty when I create a projection manually, it does not require refresh()

Navin_C
Forum|alt.badge.img+2
  • Participating Frequently
  • August 27, 2013
Hello njvijay, You can understanding this behavior of Vertica with above reply form Pravesh, If a table is loaded when you create projection manually The data is already present in your super projection and you are creating a new projection manually and deploying it, so you need to manually refresh projections so that the new projections can load all the data into them as required. If table is empty when you create projection manually The data is not loaded yet into the table that means there are no super projections, so when you load data or your firs row into the table the row gets loaded into both the super projection as well the manual projection created by you, so you don't need a refresh() Hope this helps