"Michal Taborsky" <michal@taborsky.cz> writes:
> This does decrease the the cost, but only very little (10500 -> 9800), which
> is not the solution. That thing with sequential index might work for some
> cases, that is true. Unfortunately not in this one, because I actually do
> not select random row from a table, but from a complex select query
> resultset. But thanks for the suggestions.
Why not
SELECT * FROM table LIMIT 1 OFFSET random(SELECT count(*) FROM TABLE);
I don't know if this is the exact syntax but you get the idea...
-Doug