How best to provide sets of data as arguments to queries?
Problem
If I have a query, where I want to exclude some set of values from the result then I might want to inner join on a table containing that set of values. This has advantages over use of Where clause predicates, not least:
Questions
If I have a query, where I want to exclude some set of values from the result then I might want to inner join on a table containing that set of values. This has advantages over use of Where clause predicates, not least:
- as the cardinality of the set grows
- when using parameterised queries, where the cardinality of the set varies.
Questions
- What is the best approach to solving this problem in Vertica?
- What other approaches might be valid solutions?
- Do these approaches vary as the cardinality of the set to be passed to the query varies (eg: small vs large, statistics, etc...)?
- What approaches to optimising this, both for the insert time, and the subsequent use in queries might be useful/considered?
0
Comments
Also take a look on Transform UDF + UDF parameters (it doesn't fit your requirements, but can be helpful when one or two parameters should be passed to function):
1. https://my.vertica.com/docs/6.1.x/HTML/index.htm#15767.htm
2. https://my.vertica.com/docs/6.1.x/HTML/index.htm#18083.htm