• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Serving from SQL > Scalable Alternative

Scalable Alternative

Another possibility is that we can just get all the questions and set the internal pointer to a random row. While it does require a large space for storing the result, this solution will work better if our QuIDs have a lot of holes, if questions are often deleted, or if they are entered in nonsequential order. The code necessary follows the logic in Figure 13.3 and looks like this:

Figure 13.3. Alternative Linear QuID Selection Method



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint