From: Martin Gainty Date: July 3 2009 2:18pm Subject: RE: Best approach for DB-based event logging? List-Archive: http://lists.mysql.com/mysql/218032 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_b31a7e56-dc23-4d9a-a031-81090aea635e_" --_b31a7e56-dc23-4d9a-a031-81090aea635e_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Nigel/Marcus/Johann mg>hopefully quick answer >=20 > nigel wood wrote: > > > > Here's a rough table stucture. The indexes in events tables would be = =20 > > TargetId. mg>there would be need to be a 1:1 correspondence between mg>TargetId index and Username..all of your other tables would need to know mg>the TargetId which would have to be somehow lookedup mg>best to stick with a non-unique index on Username which everyone can div= ine from firstName and lastName But problably TargetId+EventDate probably eventId+event date=20 mg>i would suggest switching this to a comibination og Username + EventDate > > as you found more uses/added paging. > > > Well that didn't format very well :-( The tables structures are: >=20 > User/Actor > =3D=3D=3D=3D=3D=3D=3D > TargetId > Username mg>pretty light structure ..what about contact and or demographic informati= on for the user? > mg>this table maybe unnecessary as you can store the text directly into the= table=20 > EventType > =3D=3D=3D=3D=3D=3D > EventTypeId > LogMesssageText (optional) >=20 > CurrentEvents=2CArchivedEventsNN=2CMergedEvents > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > EventId > TargetId mg>i would substitute in Username for TargetId > EventTypeId mg>diskspace is cheap and the ability to store a long message text is cheap mg>usually handled by appserver thru 'locale specific' resource properties > EventData > EventDate >=20 >=20 > HTH >=20 > Nigel >=20 > --=20 > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@stripped= om >=20 mg>bedankt=2C mg>Martin _________________________________________________________________ Windows Live=99 SkyDrive=99: Get 25 GB of free online storage. http://windowslive.com/online/skydrive?ocid=3DTXT_TAGLM_WL_SD_25GB_062009= --_b31a7e56-dc23-4d9a-a031-81090aea635e_--