Help for database design

I have created a database for Piwik Pro RAW data but i am getting issue with that, unable to get data faster. I need a unique record as Primary key to fetch it faster, can you please help me in this regard.
Thanks

Hi @chohan,

session_id(+event_index - as a solution for events) and event_id are randomly generated so there is a small chance of a duplicate. What you could try is to combine things like event_id and server_time to create a unique primary key. It will be better then just event_id.

Best,
Oliwer

Hi @Oliwer_Kaczmarek
Thank you very much your answer,
I am still issue because session_id is not a unique, and by combining session_id & visitor_id it has duplication, while combination of session_id, visitor_id & event_id is provide me duplication.

Regards
Chohan

If it’s issue because of the same visitor then you could add visitor_session_number to session_id but sadly there is no perfect solution.

Best,
Oliwer

@Oliwer_Kaczmarek
Thank you very much for your feedback, I Hope this will help out me.

Regards
Chohan