You’re right. I didn’t catch that. No need to have email in the PRIMARY KEY.
On Jan 21, 2014, at 5:11 PM, Jon Ribbens <jon-cassan...@unequivocal.co.uk> wrote: > On Tue, Jan 21, 2014 at 10:40:39AM -0800, Drew Kutcharian wrote: >> Thanks, I was actually thinking of doing that. Something along the lines >> of >> CREATE TABLE user ( >> id timeuuid PRIMARY KEY, >> email text, >> name text, >> ... >> ); >> CREATE TABLE user_email_index ( >> email text, >> id timeuuid, >> PRIMARY KEY (email, id) >> ); >> And during registration, I would just use LWT on the user_email_index >> table first and insert the record and then insert the actual user record >> into user table w/o LWT. Does that sound right to you? > > Yes, although unless I'm confused you don't need "id" in the > primary key on "user_email_index", just "PRIMARY KEY (email)".