You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a more specific issue than #707 which this issue is based on.
#764 describes the behavior of using pivot to select multiple fields and place them into a single row rather than generate multiple from statements and using join to combine them. We will need to implement that behavior for selectors and raw queries that contain multiple fields.
We will also probably need the transpiler to be schema-aware or we will need the query engine planner to be capable of optimizing out the unnecessary pivot when we generate the following:
The planner could potentially use the schema information to recognize that r._field == "host" will always be false. Then it rewrites the filter to be just r._measurement == "cpu" and r._field == "usage_user". Then it recognizes that the pivot is pivoting on a column that will only feasibly have one value and it can be replaced with a rename to the proper column name.
That, or the transpiler can become schema-aware and generate the correct filter. I like the idea of the planner doing it because it would be a good test of a more complicated optimization, but making the transpiler schema-aware is probably more simple.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Please reopen if this issue is still important to you. Thank you for your contributions.
This is a more specific issue than #707 which this issue is based on.
#764 describes the behavior of using pivot to select multiple fields and place them into a single row rather than generate multiple
from
statements and usingjoin
to combine them. We will need to implement that behavior for selectors and raw queries that contain multiple fields.We will also probably need the transpiler to be schema-aware or we will need the query engine planner to be capable of optimizing out the unnecessary pivot when we generate the following:
The planner could potentially use the schema information to recognize that
r._field == "host"
will always be false. Then it rewrites the filter to be justr._measurement == "cpu" and r._field == "usage_user"
. Then it recognizes that thepivot
is pivoting on a column that will only feasibly have one value and it can be replaced with a rename to the proper column name.That, or the transpiler can become schema-aware and generate the correct filter. I like the idea of the planner doing it because it would be a good test of a more complicated optimization, but making the transpiler schema-aware is probably more simple.
The text was updated successfully, but these errors were encountered: