Note that there are some explanatory texts on larger screens.

plurals
  1. POIndex/key on three fields or concat() fields into another column
    primarykey
    data
    text
    <p>My community website will take registrations from residents via a registration form which will have three list boxes for Block, Floor number and Door number. </p> <p>My first question is - Since I would need to retrieve the apartment number for some operations, will storing the three fields in three different columns slow down the retrieval of data/reports? Would it be a better idea to add another field to the table that stores the concatenated value and use that for retrieval?</p> <p>My second question is: If I were to go the concatenation route, would it make a difference whether I concatenated them before sending to the database (in the processing php) or if I set the column in the table such that it took the three values in the table and performed the concat?</p> <p><strong>EDIT</strong></p> <p>Based on the responses, a little explanation might add value here:</p> <p>My form/table is meant for comments and suggestions by members. Querying the table could be:</p> <ol> <li>By members to check the status of their complaint. There could potentially be say 20 such calls a day - rarely more than this.</li> <li>By the admin calling for reports from the admin page - this could be unanswered complaints, resolved complaints, sending thank-you notes for suggestions, etc. This could also mean getting unresolved complaints per block etc.</li> <li>By the admin when he responds to the member - this will call an update to the record.</li> <li>By members sending in new complaints or suggestions.</li> </ol> <p>So, effectively, querying could be by individual apartment numbers or by block names. I already have a check-complaint-status form that uses the three column s separately and that isn't an issue as it involves retrieval of a single record. What if, say, there are 30 records that will turn up in a B-block report? Or a hundred? Will concatenation on retrieval be an issue in that scenario?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload