Re: Select Single Random Record

Petr Jakeš <[email protected]>
Newsgroups gmane.comp.python.sqlobject
Message-ID <CAERU-VaSAK0hO8z1-9PfUdDQcqnbdh_xk5m+abFFwzGYMBekYg@mail.gmail.com>
> Although this might work in the particular application, but
> it is hardly ideal to make two queries, nor to load a long list
> of IDs.  Is there a way to do it with a single query?
>
> 1)
Is your task really "time critical"?
How many records (IDs) do you expect to be returned using the first select?
How many kb will it take? Is the list size a real problem for your Internet
connection?
How often do you expect to release the select querry?

2)
what is your target database engine?
some databases allow "rand" in the select query.
see:
http://stackoverflow.com/questions/19412/how-to-request-a-random-row-in-sql

Petr

------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev

_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.