MySQL Forums
Forum List  »  Stored Procedures

Re: Procedure that select different number of columns
Posted by: Peter Brawley
Date: October 15, 2013 03:47PM

Looks like an entity-attribute-value (EAV) model.

EAV queries are nightmares to write, they are nightmares to debug, they are nightmares to optimise, and they perform terribly. Consider reconsidering your model.

Otherwise, you'll be writing and debugging pivit tables for a long time. See "Pivot tables" at http://www.artfulsoftware.com/queries.php.

To parameterise such queries for sprocs, you'll have one more layer of complication: you'll need to write the queries as Prepared Statements.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Procedure that select different number of columns
1265
October 15, 2013 03:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.