Skip to content

Child plugin wastes space? #62

Answered by bmeares
p-zach asked this question in Q&A
Apr 24, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

@p-zach yes, each pipe has an underlying SQL table, so in your example the child would duplicate the parent because it only adds rows to the parent table.

One way to save space is to create a view that selects from the parent to act as the child. A view is basically an alias for a SELECT statement that behaves like a virtual table. For example, a view like this would mimic the child data from your example plugin:

CREATE VIEW AS plugin_test_derivative_a_deriv_1 AS
SELECT
    timestamp, random1, random2,
    (random1 * 2) AS deriv_random1,
    (random2 + 0.5) AS deriv_random2 
FROM plugin_test_derivative_a

You could even drop the table for the child plugin and remove its .sync() and use the…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@p-zach
Comment options

Answer selected by bmeares
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants