I have a table called multiturnTable which records games between two 
players, so has two fields "player1" and "player2".  Currently when, for 
instance, trying to find all games involving a specific player, I search 
based on player1=x OR player2=x.  I'm fairly sure this is anti-good db 
design.

I am considering adding a gamesInvolving table which would be simply:

TABLE gamesInvolving (id INTEGER PRIMARY KEY AUTOINCREMENT, player TEXT 
COLLATE NOCASE, multiturnId INT, won INT)

I would then replace my player1= OR player2= queries with some kind of 
join based on a select from gamesInvolving.

My two questions are simply:

1. Would you expect this to be significantly faster?
2. Is there a better way?

Thanks, as always.
Ian
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to