Welcome Guest, Not a member yet? Register   Sign In
setting priority on queries
#1

[eluser]D-dawg[/eluser]
Hi - I got an optimizationtip that Select HIGH_PRIORITY would be a good idea, so how do I set that with codeigniter when i use $this->db-> ??

thank you
#2

[eluser]cideveloper[/eluser]
This will work

Code:
$this->db->select('HIGH_PRIORITY field1, field2', FALSE);
$query=$this->db->get('table');
#3

[eluser]D-dawg[/eluser]
thx bro Smile

Can I mark it as the answer somehow - haven't quite gotten around this forum yet.
#4

[eluser]D-dawg[/eluser]
[quote author="progr@mmer" date="1294054413"]This will work

Code:
$this->db->select('HIGH_PRIORITY field1, field2', FALSE);
$query=$this->db->get('table');
[/quote]

Oh - and how would you go about setting priority on insert and update queries?
#5

[eluser]smilie[/eluser]
With active record you could try (not tested):

Code:
$this->db->set('HIGH_PRIORITY field1="field2"', '',FALSE);
$query=$this->db->insert();

Or otherwise with 'regular' $query = "INSERT ..."; $this->db->query($query);

Cheers,
Smilie
#6

[eluser]D-dawg[/eluser]
is there any way I can still take advantage of the features of codeigniter, not having to write the entire query, so I can do liek:

will
Code:
$this->db->set('HIGH_PRIORITY');
work in relation with:

Code:
$this->db->set('rating','((rating*votes)+'. $rating.')/(votes+1)', FALSE);
    $this->db->set('votes','votes+1', FALSE);




Theme © iAndrew 2016 - Forum software by © MyBB