user3222101
user3222101

Reputation: 1330

Best way to use input and output tables

There is a data model(sql) with a scenario where it uses one input table and it is fed into the prediction model(python) and some output variables are generated onto another table and final join is done between input table and output table to get the complete table(sql). Note: there could be chances that output table doesn't predict values for every primary key in the input table.

Is it good approach to create one table that is fed as input to prediction model and the same table is updated with the output variables i.e. we pass those columns as complete null during input and they are updated as the values are predicted? If not, then what are the disadvantages for the same.

Upvotes: 0

Views: 268

Answers (1)

Kevin Postlewaite
Kevin Postlewaite

Reputation: 615

It's difficult to say without knowing what the database load and latency requirements are. I would typically avoid using the same table for source and output: I would worry about the cost and contention of simultaneously reading from the table and then writing back to the table but this isn't going to be a problem for low load scenarios. (If you're only running a single process that is doing both the reading and writing then this isn't a problem at all.)

Separating Input/Output may also make the system more understandable, especially if something unexpected goes wrong.

Upvotes: 1

Related Questions