On Dienstag, 5. August 2008, Daniel Friesen wrote:
> MediaWiki makes use of a `page_random` field for the [[Special:Random]]
> page.
> I'm assuming that it grabs the highest value from that index, then when
> viewed regenerates the page_random value there in some way.
>
> It would be worth it to look over how MediaWiki deals with random pages,
> and either integrate with it or do random queries in a similar way.

Right, that works and we could do something similar. The point is that 
MediaWiki returns only a single random page each time. Hence the order of 
pages is not a problem. If you would return more than one result, as in SMW, 
then you would always retrieve results in the same order; certain results can 
never appear in one result set in spite of all randomness.

On the other hand, retrieving arbitrary results from unconnected places 
throughout the data set clearly thwarts fundamental methods of database 
optimisation. True randomness would mean that the DB cannot be prepared for 
it, has no index to use, and must read results from all over the (physical) 
disk. It is clear that this fails as soon as the DB table size exceeds the 
available memory. So maybe a semi-random method as in MW would have to be 
accepted.

Regards,

Markus

>
> ~Daniel Friesen(Dantman, Nadir-Seen-Fire) of:
> -The Nadir-Point Group (http://nadir-point.com)
> --It's Wiki-Tools subgroup (http://wiki-tools.com)
> --The ElectronicMe project (http://electronic-me.org)
> --Games-G.P.S. (http://ggps.org)
> -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
> --Animepedia (http://anime.wikia.com)
> --Narutopedia (http://naruto.wikia.com)
>
> Markus Krötzsch wrote:
> > On Montag, 4. August 2008, Asheesh Laroia wrote:
> >> On Fri, 25 Jul 2008, Steren wrote:
> >>> hi,
> >>> I wrote yesterday a small patch for SMW. It allows to sort query
> >>> results randomly.
> >>> Creative Commons needed this feature for its Casestudies project.
> >>
> >> [Further details snipped]
> >>
> >> Dear SMW devs,
> >>
> >> Can this patch be included in the SMW svn?
> >>
> >> That would be lovely.  If there is a reason it can't, let's see if it
> >> can be worked out!
> >
> > Well, I guess it can be included. Of course it is clear that this just
> > cannot perform very well, so there should probably be a switch to enable
> > it only if desired. It might be good to have a MediaZilla entry for that,
> > so I do not forget.
> >
> > One could also think about some faster not-so-random solution as a
> > fallback for larger sites.
> >
> > -- Markus
> >
> >> -- Asheesh.
> >
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge Build the coolest Linux based applications with Moblin SDK &
> > win great prizes Grand prize is a trip for two to an Open Source event
> > anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Semediawiki-devel mailing list
> > Semediawiki-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-devel



-- 
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    [EMAIL PROTECTED]

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to