Table1
------------
ID
IdColumn1
Idcolumn2
Table2
------------
ID
IdColumn
IdPair
Both of them contains the same data.
Table1 have both column populated, Table2 have those columns stored on two rows.
So, if Table1 contains n rows, Table2 will have 2 * n rows
Wich query is faster ?
select * from Table1
where IdColumn1 = x or IdColumn2 = x
or
select * from Table2 where IdColumn = x
I already choose Table2 scheme and I have over 400.000 rows until now and over 1000 unique visitors per day. Every day is added over 2000 rows in this database. My website keep growing very fast.
Don't ask me why there are so many rows, they play games in online competitions and those rows are matches between players.
I'd choose Table2.
With the Table1 schema you need two indexes at least, one on IdColumn1 and one on IdColumn2 and you can query it efficiently using:
select * from Table1 where IdColumn1 = x
union all
select * from Table1 where IdColumn2 = x;
But at least one of the indexes is non-clustered and you'll have a lot of logic juggling to identify all items related to a player, since they can be on either IdColumn1 or on IdColumn2. And just think at the mess a 3 way game will bring in the future (3 players, add IdColumn3...).
Table2 is better, as it has a clear purpose: stores all the games a player had participated in, clustered by the player Id. It can be interogated more simply, it can be structured more simply, and can be extended to more players per game later on.
Not sure what PairId is though. Your data model is a typical many-to-many relation, just replace 'Player' with 'Student' and 'Game' with 'Course' and you'll see that you ahve exactly the canonical Data Modeling 101 course structure of Students-Course (in your case it so happens that a game (=course) can have exactly 2 players (=students), but thet's a detail. You're still talking about a typical 3 table relationship (1 for games, 1 for players, one for player-to-game participation).