Hi, your tip really worked. Thanks. Please see the code below:

DAL:

    indiban_meses = Meses.on(Indiban.meses_id == Meses.id)
    indiban_anos = Anos.on(Indiban.anos_id == Anos.id)
    indiban_indicadores = Indicadores.on(Indiban.indicadores_id ==
Indicadores.id)
    indiban_empresas = Empresas.on(Indiban.empresas_id == Empresas.id)
    indiban_eleban = Eleban.on((Indiban.empresas_id ==
Eleban.empresas_id)&(Indiban.meses_id == Eleban.meses_id)&(Indiban.anos_id
== Eleban.anos_id))
    eleban_elementos = Elementos.on(Eleban.elementos_id == Elementos.id)


    rows = db((db.indicadores.id==rspla_id)&(db.elementos.id==ativo_id)&
              (db.meses.id==mes_id)&(db.anos.id==ano_id)).select(Empresas.nome,
Meses.abrev, Anos.numero,
                                                           Eleban.valor,
Indiban.valor, Empresas.id,

 join=[indiban_meses, indiban_anos,

 indiban_indicadores, indiban_empresas,

 indiban_eleban, eleban_elementos],

 orderby=~Eleban.valor, limitby=(0, 10))

SQL:

    sql = "SELECT empresas.nome, meses.abrev, anos.numero, eleban.valor,
indiban.valor, empresas.id "
    sql = sql + "FROM indiban INNER JOIN meses ON indiban.meses_id =
meses.id "
    sql = sql + "INNER JOIN anos ON indiban.anos_id = anos.id "
    sql = sql + "INNER JOIN indicadores ON indiban.indicadores_id =
indicadores.id "
    sql = sql + "INNER JOIN empresas ON indiban.empresas_id = empresas.id "
    sql = sql + "INNER JOIN eleban "
    sql = sql + "ON indiban.empresas_id = eleban.empresas_id "
    sql = sql + "AND indiban.meses_id = eleban.meses_id AND indiban.anos_id
= eleban.anos_id "
    sql = sql + "INNER JOIN elementos ON eleban.elementos_id = elementos.id
"
    sql = sql + "WHERE indicadores.id = 3 AND elementos.id = 5 "
    sql = sql + "AND meses.id = 5 AND anos.id = 22 "
    sql = sql + "ORDER BY eleban.valor DESC LIMIT 10;"
    rows = db.executesql(sql)



2016-11-06 18:05 GMT-02:00 Niphlod <niph...@gmail.com>:

> there was an issue on more than 1kb that showed pretty much a limit on
> python's implementation, that's solved in recent releases of the scheduler
> but I wonder if the "tax" on that sem_wait() is trying to flush off or read
> the buffered output of the task.
>
> On Friday, November 4, 2016 at 11:50:14 PM UTC+1, Erwn Ltmann wrote:
>>
>> On Friday, November 4, 2016 at 10:44:31 PM UTC+1, Niphlod wrote:
>>>
>>> BTW: do your task write a lot on stdout/stderr and/or return huge
>>> results ?
>>>
>>
>> Probably. I wrote into the log more than usual. :( Mostly DEBUGs - it's
>> possible to switch off them.
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Gualter Portella

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to