listing random records + filter/search

Hello,

My application has a number of members.

CRUD generates /member/index action, and I modified some codes for advanced search/filter function from "/member/admin" action thanks to this article

I have no problem with filter/search function.

I would like to display members in a manner "order by rand()". My application shows members order by id all the time.

The followings are source codes:

controller/MemberController.php


    public function actionIndex()

    {   

        $model = new Member('lookFor');

        $model->unsetAttributes();  // clear any default values


        if(isset($_GET['Member']))

            $model->attributes=$_GET['Member'];


        $this->layout='//layouts/column1';

        $this->render('index',array(

                    'dataProvider'=>$model->lookFor(),

                    'model'=>$model,

                    )); 

    }

models/Member.php


    public function lookFor()

    {

        $criteria=new CDbCriteria;

        $criteria->compare('gender',$this->gender);

        $criteria->compare('region',$this->region,true);

        $criteria->compare('job',$this->job,true);

        $criteria->compare('style',$this->style,true);

        $criteria->compare('personality',$this->personality,true);

        $criteria->compare('body_type',$this->body_type,true);

        return new CActiveDataProvider('Member', array(

                    'criteria'=>$criteria,

                    ));

    }



views/member/index.php


<?php

$this->widget('zii.widgets.CListView',

        array(

            'id'=>'member-grid',

            'dataProvider'=>$dataProvider,

            'itemView'=>'_view',

        )   

    );  

?>



Please, help me.

I answer myself. I appended the following code to model/Member.php


$criteria->order = 'rand()';

It works fine, but if possible I want to improve the performance instead of "order by rand()".