Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: [OT] When coders don't see eye to eye

by Errto (Vicar)
on Oct 30, 2006 at 04:16 UTC ( [id://581193]=note: print w/replies, xml ) Need Help??


in reply to Re: [OT] When coders don't see eye to eye
in thread [OT] When coders don't see eye to eye

I have trouble imagining circumstances where I'd even consider A as an option.
I agree in general approach B is better, but I think there are circumstances where it's not. In particular, for a more complex application where there are lots of places that touch this data, and you want the vast majority of them to ignore those marked as deleted, it might be easier to have the deleted entries not be in the main table at all (which I realize now is different from what the OP posted) but rather in a sort of duplicate table off to the side used only for administrative/reference purposes.
  • Comment on Re^2: [OT] When coders don't see eye to eye

Replies are listed 'Best First'.
Re^3: [OT] When coders don't see eye to eye
by Anonymous Monk on Oct 30, 2006 at 12:23 UTC
    Only if the majority of your posts will be deleted. Which I assume won't be the case. If you have lots of posts, and lots of code querying them, you want access to them as fast as possible. The access will be faster if the database can cache more. Databases cache by page. If a row is retrieved, the entire page the row will be in is fetch from disk, and kept in cache. The smaller your row, the more rows can fit in a database. The amount of pages that can be cached is limited by the environment. So, if you have more rows per page, then you have more cached rows for a given fixed number of pages that can be cached.

    In other words, approach A wastes memory. And that can hurt performance. (Of course, it may not. Unless you measure you won't know. And maybe the difference in performance is insignificant. And even if A has better performance, it has to make a huge difference before I choose such a dirty design - it's feels worse than running without strict and warnings).

    I wouldn't even have a 'deleted' column in the post_tbl table. This information can be deduced from the post having an entry in the removed_tbl table.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://581193]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found