the DDL for the underlying table(s) , using SELECT EXPORT_OBJECTS('','<schema>.<table>' ,FALSE)
the exact query you fired ?
It could be that you are trying to query from a non-super projection, and one of the columns you refer to is not in the projection you would like, or that you want to query a non-aggregated value from a Live Aggregate Projection, or there are so many other possible reasons ...
Hi, have you checked that the projection is up to date, and also have you run ANALYZE_STATISTICS so Vertica will evaluate cost of the new projection? If you run EXPLAIN on the query with hint, it may show NO STATISTICS or some other issue that is forcing an incorrect decision. You might also try listing all fields explicitly in order they are in the projection instead of SELECT *.
Comments
Hi Absantobenten
Can you post
SELECT EXPORT_OBJECTS('','<schema>.<table>' ,FALSE)
It could be that you are trying to query from a non-super projection, and one of the columns you refer to is not in the projection you would like, or that you want to query a non-aggregated value from a Live Aggregate Projection, or there are so many other possible reasons ...
You are right. The query was doing a SELECT * and the projection I needed does is missing one column. I will fix this and then try again.
I listed the specific column names and ensured it was found in the projection and it didn't work.
what else can i try? thanks.
Can you post your SQL with the PROJS hint? Let's make sure you are using correctly.
SELECT *
FROM myschema.mytable /*+PROJS('myschema.mytable_projection')*/
ORDER BY 1, 2, 3
;
Hi, have you checked that the projection is up to date, and also have you run ANALYZE_STATISTICS so Vertica will evaluate cost of the new projection? If you run EXPLAIN on the query with hint, it may show NO STATISTICS or some other issue that is forcing an incorrect decision. You might also try listing all fields explicitly in order they are in the projection instead of SELECT *.
I'd start by:
If that works, then I'm not making any column based mistakes.
Then, I'd go:
, to profile it and to save any query events worth analysing.
Then, using
vsql
:You will get a lot of info bits of this format:
... and some of it might shed some light why the hint you specified was not considered.
Also -
Run this:
The explain plan output usually also logs what was done while considering hints.
If you don't find the exlanations yourself - can you at least share the query events and the explain plan, just as I did above?