I have not followed the details of this thread but you can create indices on any column outside web2py or using executesql(). It was a design choice not to suport this since it exponentially increases the complexity of migrations. It is easy enough to add indices form the database shell.
On Jul 21, 2:07 am, rb <[email protected]> wrote: > > > Further, I ***can*** just add a 'orderby' clause to the select() > > > function but this is expensive. Correct me if I'm wrong but I believe > > > that a table's primary key is automatically indexed. When selecting on > > > the primary key the db automatically uses its index - which speeds > > > things up quite a bit. Adding indices to much-used queries can really > > > speed things up. So if I cannot use indices in the DAL ***and*** I > > > cannot have my primary key indexed then _sigh_ isn't there room for > > > improvement here? > > > You can always add indices to the table, but that is something that > > cannot be directly done (currently) via the DAL, you have to execute > > the SQL to create them manually (DAL does support to run direct SQL > > when needed) > > Yeah. I want to use the DAL to make my db code as transportable as > possible. I _think_ that things like table constraints are *not* very > transportable using SQL - but I can do this using executesql() until > the DAL provides such. I think the thing to do is to write some > external (python) code to create the tables and then set migrate=False > when calling SQLDB in web2py. > > This is my current plan. > > -- > Rb --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

