I have a situation and do not know exactly where the problem is.
I have two tables: client and client_addresses.
The client has about 5000 records, and every client has in client_address one or two addresses.
A client can have multiple addresses specified in the table client addresses, but one is the default.
If I create a grid application that take data only from table client it’s run ok (fast).
If I create a grid application that show the client and the default addresses it’s work very slow, it’s take about 20 sec.
I tested this in two way in SQL Select Statement.
I use subselect query like
(SELECT address FROM client_address WHERE id_client=cl.id_client AND default=1) AS address,
I use INNER JOIN like
LEFT OUTER JOIN client_address ON client.id_client = client_address.id_client AND client_address.default=1
The interesting think is that I run this two query in other context, the data is load and show very fast.
For example, I created in a blank application a simple table that is filled with data using the query mentioned above and it’s loading very fast.
So it’s not a problem with speed of server.
If I use exactly the same query but in grid application, the application it’s load very slow, also when navigated from a page to another or when I clicked the advanced search or quick search.
Can be this a bug in grid application ?
If not, why in grid application work sow slow and otherwise work fast ?