Godley / Music-Library

Repo for all FYP work, including meeting logs, implementation, report and any other necessary documents. Will be a mix of tex, python, word and pdf documents
GNU General Public License v2.0
5 stars 3 forks source link

getPieceInfo could be merged into 1 query #188

Open Godley opened 9 years ago

Godley commented 9 years ago

getPieceInfo could use the following:

SELECT instrument.instrument_id, clef.clef_id, clef.instrument_id, key.key_id, key.instrument_id, meter.meter_id, tempo.tempo_id, piece.composer_id, piece.title FROM instrument_piece_join instrument, clef_piece_join clef, key_piece_join key, time_piece_join meter, tempo_piece_join tempo, pieces piece WHERE piece.filename = ? AND clef.piece_id = piece.ROWID AND key.piece_id = piece.ROWID AND meter.piece_id = piece.ROWID AND tempo.piece_id = piece.ROWID

whilst this may confiscate the code a little bit, this would pull out all of the ids needed from all the join tables.

Godley commented 9 years ago

actually that query won't work, because it uses AND for all the thingy values - this will return nothing if we have no data on absolutely every thing we're tracking. I'm going to leave this alone for now and maybe come back to it at a later stage.