Alfredo Cole <[EMAIL PROTECTED]> wrote:
> select tr.*,ma.nombre from cbtran as tr, cbma as ma where
> tr.empresa='1' and tr.mes='1' and tr.anio='2002' and
>
>concat(ma.empresa,ma.clase,ma.tipo,ma.mayor,ma.grupo,ma.costo,ma.cuenta,ma.subcuenta)=concat(tr.empresa,tr.cuenta)
>
> order by tr.anio
Hi Alfredo,
What an amazing piece of code!
The join statement is a computation on both sides, so therefore no index is of
material use.
Consequently a table scan would be required.
Have you tried EXPLAIN?
Regards,
=dn
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi:
>
> Using MySQL
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi:
Using MySQL version 3.23.39-Max, SuSE 7.2
I have two tables, cbtran with 46564 rows and cbma with 4184 rows.
Both tables are indexed.
The following query:
select tr.*,ma.nombre from cbtran as tr, cbma as ma where
tr.empresa='1' and tr.mes='1