I have a MySQL database schema for storing uploads, where each configuration can be associated with a user account (user_id) or uploaded as a guest without an associated user account (null user_id). The schema looks like this:
CREATE TABLE uploads (
id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
user_id BIGINT UNSIGNED,
category_id TINYINT UNSIGNED NOT NULL,
created_at BIGINT UNSIGNED NOT NULL,
updated_at BIGINT UNSIGNED NOT NULL,
s3_key VARCHAR(255),
INDEX(user_id, updated_at),
INDEX(user_id, category_id, updated_at),
);
Assuming 10 million uploads, 5 million guest uploads and 5 million user uploads
should I create separate table specifically for uploads associated with user accounts? Guest uploads will be queried only by the primary key (id) Goal is to maximize performance.