Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose we have 10000 records of any product. User search on our website with his given criteria. so we output search results based on given criteria.

Now Admin want to rank products in search. so simple thing is to make order field on product table and order by it in query.

So is there any alternative and best ways for it?

share|improve this question
What is the ranking based on? Is the ranking arbitrary? If so, you need to store the ranking on the product table. Is the ranking based on something intrinsic to the product (like alphabetical by vendor, product number, or ascending price)? If so you already have something stored. Is the ranking based on something you can calculate (like frequency of purchase or user views)? If so you need to track that data in detail somewhere and then decide if you want to summarize it periodically for performance reasons. You need to give more information about your requirements if you expect an answer. – Joel Brown Dec 27 '13 at 18:10
No No...all points you mention is already implemented... but now for example user's crietia we get results from all you said... now we need to adjust these final results as per our wish.... i.e. some will pay us to get their item on higher position. – dev.mraj Dec 28 '13 at 5:56
In addition to the "organic" ranking criteria that apply automatically to all 10,000 records you can also have an override ranking for some products, which takes precedence over the organic rank if it exists. This could be stored on the product table and maintained manually or it could be stored in another transaction table and be edited automatically based on a payment page - there are lots of options. Your question is much too vague to get an answer on DBA.SE. You need to give much more specific information about your problem is you expect specific suggestions. – Joel Brown Dec 28 '13 at 14:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.