Ugh, please don't pack your data columns like "anon_xxxx". Use the DBMS. Create an anonymous column of type boolean. You really need to normalize this table heavily. See any good SQL intro on rationalization/normalization. Otherwise you are going to take a serious performance hit. Consider these two tables:
Users ("anon_xxx" used in id)
id, data
vs.
Users (boolean flag)
id, anon, data
In the first example, to retrieve a given username, your perl code has to retrieve EVERY row, split the id field on "-" and check for a match.
In the other example you simply ask the database for the row(s) "where id = $userid and anon = false". The database will be much faster because it can use indexes to skip a great deal of the records and quickly zero in on the user id of your choice. Remeber, a good database (ala Postgres) will be written in C and is optimized for grinding through large amounts of data efficiently.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.