Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:51:31+00:00 2026-06-01T08:51:31+00:00

In order to avoid soft delete I am creating a recycle bin database. The

  • 0

In order to avoid soft delete I am creating a recycle bin database. The main database will junction to it. Here is an example of two possible junction approaches, and I was hoping for some input on which would be more efficient?

For simplicity, lets say there are two tables, Order and Invoice (and each invoice only has 1 order).

Order
-----
OrderId
InvoiceId
Description
Date
NumberOfStuffOrdered

Invoice
-------
InvoiceId
Description
Price
Tax
Shipping

For a junction of these tables to the recycle bin, I was unsure which approach to take.

Approach 1:

DeletedOrder
------------
DeletedOrderId
OrderId
RecycleBinId
Date
Reason

DeletedInvoice
--------------
DeletedInvoiceId
InvoiceId
RecycleBinId
Date
Reason

Approach 2:

DeletedRecords
--------------
DeletedRecordsId
RecordPrimaryKeyId
RecycleBinId
RecordType
Date
Reason

Although Approach 1 will take more table space in the database, it will have less rows per table and have fast query times as the system matures. Approach 2 consolidates having to make an extra deleted table for each table in the database, but as the system matures will grow in size and become slow to query.

Which one will be more efficient overall, or is there a better way to approach this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:51:32+00:00Added an answer on June 1, 2026 at 8:51 am

    It depends on how much you need to retain, and how you will be using it. If you need to record all the details of your invoices and orders (NumberOfStuffOrdered, Tax, etc.) the specific delete tables are necessary. If you merely need to record the fact that the row once existed (what you have now: Id, type, Date[Deleted], Reason), we cycle back to “it depends”.

    If no one’s really going to use the data, if you just need the fact that it existed on the off-chance of an IRS audit some day, then a single table should be adequate. (The analogy is the warehouse filled with boxes of forms going back 70 years — it’ll take time, but you’ll find it eventually.) However, if you are regularly going to access this data and run reports, do data mining, or whatever on it, then you’re best off designing tables to support those process–normalized, star schemas, or whatever’s useful.

    Generally, I suspect a big table with a few indexes supporting frequent queries should suffice, unless good performance is critical.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to avoid namespace bloating, I use packages. For example, let Foo be
In order to avoid magic strings when running the ExecuteStore command is it possible
i am using a HashSet in order to avoid having two (or more)items with
I have never written copy constructor, so in order to avoid pain i wanted
In order to avoid freezing of GUI, I wanted to run method connecting to
In order to avoid spamming, I would like to add a waiting time to
In order to avoid a huge hassle with ugly UI glitches from the popover's
I made a vector set in order to avoid thrashing the GC with iterator
I have created several WCF services. In order to avoid adding service references in
in order to avoid an include circle, I have replaced an #include that was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.