I am creating a job service which has features like radial search, full-text search, a chance to do full-text search + disable certain job entries (for example not-checking a textbox and no more coming back full-time jobs).

The developer who's focusing on Sphinx wants the database information to any or all be saved as intergers having a key (so underneath the table "Job Type" values may be saved for example 1="part-time" and a pair ofEqualsInchcomplete-time")... whereas another designers wish to keep your database as strings (so underneath the table "Job Type" it states "part-time" or "full-time".

It is possible to reason to help keep the database as ints? Or should strings be fine?

Thanks!

Master

Selecting your key may have a dramatic performance impact. Whenever you can, use ints rather than strings. This really is known as utilizing a "surrogate key", in which the key presents a distinctive and quick strategy for finding the information, as opposed to the data standing by itself.

String evaluations are resource intensive, potentially orders of magnitude worse than evaluating amounts.

You are able to drive your UI off from the surrogate key, but show another column (for example job_type). By doing this, whenever you hit the database you pass the int in, and steer clear of searching right through to the table to locate a row having a matching string.

If this involves joining tables within the database, they'll run much faster for those who have int's or any other number as the primary secrets.

Edit: Within the specific situation you've pointed out, should you have only two choices for what your area might be, and it is unlikely to alter, you might want to consider something similar to a little area, and also you could title it IsFullTime. A little or boolean area holds single or perhaps a , and little else, and typically is not associated with another area.

if you're normalizing your structure (i think you'll are) then number secrets is going to be most effective.

Besides the usual good reasons to use integer primary secrets, using integers with Sphinx is important, because set came back with a effective Sphinx search is a listing of document IDs connected using the matched up products. These IDs are then accustomed to extract the appropriate data in the database. Sphinx doesn't return rows in the database directly.

For additional particulars, begin to see the Sphinx manual, especially 3.5. Restrictions on the source data.