Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Query slow
Mon, Aug 4 2008 3:35 AMPermanent Link

Francisco Fernandez
Hi

I have two tables called VENTAS and VENTASLINEAS and i execute this query

Select VENTAS.CODIGO, VENTAS.FECHA, VENTAS.CLIENTE, VENTAS.SERIE, VENTAS.FACTURADO,
VENTASLINEAS.CODIGO as CODIGOL, VENTASLINEAS.ALBARAN
from VENTAS, VENTASLINEAS
where ((VENTAS.CODIGO COLLATE ESP_CI= VENTASLINEAS.ALBARAN) and ((VENTAS.FACTURADO COLLATE
ESP_CI = 'N')))
order by CLIENTE, ALBARAN

In DBF tables it spend 10 seconds but in elevatedb with the same tables and index more
than one hour. Anybody can say to me why?

Thank you
Mon, Aug 4 2008 5:30 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Francisco

My guesses would be 1. doing the join in the WHERE clause and 2. not having case insensitive indices.

I can be more certain if you post the execution plan. In EDBManager check the box saying Request Execution Plan and then down with the results there'll be a tab saying Execution plan - its very helpful for sorting these things out

In the meantime try

Select VENTAS.CODIGO, VENTAS.FECHA, VENTAS.CLIENTE, VENTAS.SERIE, VENTAS.FACTURADO,
VENTASLINEAS.CODIGO as CODIGOL, VENTASLINEAS.ALBARAN
from VENTAS,
join  VENTASLINEAS ON VENTAS.CODIGO COLLATE ESP_CI= VENTASLINEAS.ALBARAN
where VENTAS.FACTURADO COLLATE ESP_CI = 'N'
order by CLIENTE, ALBARAN

Roy Lambert [Team Elevate]
Mon, Aug 4 2008 5:58 AMPermanent Link

Francisco Fernandez
Roy

I have changed query with JOIN and it now run faster than DBF files.

Thank you
Image