0
の一意のインデックスを化合私の状況です:MySQLはここでVARCHAR型
• I have a table of users <br><br>
• I have a table of movies <br><br>
• I have a table of user_movies that associates users to movies that stores a frequently changing "score" column on each record.<br><br>
• I need to be able to bulk update the user_movies table for speed and to do so I believe I need a unique index to be able to pull off bulk updates like this.<br><br>
• Considering each user_movie combination is unique, would it be possible to do
は、一意の識別子として(User_id--->) uid_mid (<----movie_id)
のようなものですか?もしそうなら、既存のテーブルをこれにどのように移行するのでしょうか?
私はあなたが求めていることを理解していませんが、2つの列にインデックスを作成することはできますか? "CREATE UNIQUE INDEX myindex on user_movies(user_id、movie_id)"(常にそのテーブルに対するすべてのクエリで両方のカラムを指定する場合は、カラムの順序は関係ありません)。 – EdmCoff
一意索引を作成するが、別々に作成しない2つの列を使用して一括更新を実行するにはどうすればよいですか? –
私はここで何かを誤解していると思う。一括更新はどうやって行っていますか? – EdmCoff