/dd/ -> 0_0035_inc.php
1 <?php
2
3 // 0_0035_inc.php - See code
4 // 0_0035_inc.php - author: Nico Stuurman
5
6 /***************************************************************************
7 * Copyright (c) 2002 by Nico Stuurman *
8 * ------------------------------------------------------------------------ *
9 * This code is part of phplabware (http://phplabware.sf.net) *
10 * *
11 * *
12 * This program is free software; you can redistribute it and/or modify it *
13 * under the terms of the GNU General Public License as published by the *
14 * Free Software Foundation; either version 2 of the License, or (at your *
15 * option) any later version. *
16 \**************************************************************************/
17
18 // Create indices on some widely used fields
19 $r=$db->Execute("SELECT real_tablename FROM tableoftables WHERE table_desc_name IS NOT NULL");
20 while (!$r->EOF) {
21 $real_tablename=$r->fields["real_tablename"];
22 $db->Execute("CREATE INDEX $real_tablename"."_id_index ON $real_tablename (id)");
23 $db->Execute("CREATE INDEX $real_tablename"."_title_index ON $real_tablename (title)");
24 $db->Execute("CREATE INDEX $real_tablename"."_title_index ON $real_tablename (title(10))");
25 $db->Execute("CREATE INDEX $real_tablename"."_access_index ON $real_tablename (access)");
26 $db->Execute("CREATE INDEX $real_tablename"."_access_index ON $real_tablename (access(9))");
27 $db->Execute("CREATE INDEX $real_tablename"."_ownerid_index ON $real_tablename (ownerid)");
28 $db->Execute("CREATE INDEX $real_tablename"."_date_index ON $real_tablename (date)");
29
30 $r->MoveNext();
31 }
32
33 ?>