CrazyEngineers
  • Manish
    Manish

    MemberSep 15, 2013

    Solve this sql query

    Below is a situation

    I have two database table

    1: Posts

    2: Recent Watched

    Now What I want is whenever user visits a certain post of mine, then it will make a new entry into recently watched table, through which i can see recently watched posts

    Now The Problem is If my website hits reaches more than 200 k, then this table will be filled with no of records and ultimately will make my database very heavy

    Now what I want is to delete the records from this table when it reaches certain limit automatically without any manual interference
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • The_Small_k

    MemberSep 15, 2013

    A database trigger will do the work for you😛. Which will execute the query on database event(like every time when count(row) in my table reach 30 it will delete 10 records from it)👍.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register