SQL Query Verbosity

Posts   
 
    
tmpreston
User
Posts: 18
Joined: 21-Dec-2004
# Posted on: 21-Dec-2004 04:59:29   

Hi,

I recently was asked to conduct a test of an application under dial-up (56k) link conditions. This pointed out a number of areas where too much data was being retrieved etc but I also noticed that the SQL text (displayed in SQL Profiler) is incredibly verbose. In certain testing situations there is more data being sent upstream in the unicode command text than is being retrieved. If an entity is being fetched, or a typed view where all the columns are being fetched it would be more useful if the generated SQL specified the query as SELECT * FROM ... rather than SELECT [dbo].[object].[columnA] AS [ColumnA].

Is there any way to specify this already and/or is there a good reason not to take this approach. The view was set up to retrieve only the columns needed for preview of data before selecting a single entity.

Thanks in advance and feel free to move this to a different area of the board if you feel it is appropriate.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 21-Dec-2004 09:53:53   

tmpreston wrote:

Hi,

I recently was asked to conduct a test of an application under dial-up (56k) link conditions. This pointed out a number of areas where too much data was being retrieved etc but I also noticed that the SQL text (displayed in SQL Profiler) is incredibly verbose. In certain testing situations there is more data being sent upstream in the unicode command text than is being retrieved. If an entity is being fetched, or a typed view where all the columns are being fetched it would be more useful if the generated SQL specified the query as SELECT * FROM ... rather than SELECT [dbo].[object].[columnA] AS [ColumnA].

SELECT * FROM is slower (according to sqlserver experts). Also, if the table gets another column, it is not ending up in the resultset until you change your client code. This is good. Also, at the moment you can't select a subset of the fields in an entity /view but this is added soon. The underlying code is then not changed, just the client code.

The sql is verbose, admitted, but it helps sqlserver find where to get the data way more easily. In theory you have to specify all these items anyway, you often don't have to as sqlserver can guess where to get the data, but it would be better if the query contained the information already.

The problem with less verbose sql is that you have to test a lot to be sure the sql isn't ambiguistic, i.e.: all columns are properly aliassed and it won't end up in an error. I'm not sure this is worth the effort.

Frans Bouma | Lead developer LLBLGen Pro
flo1227
User
Posts: 8
Joined: 16-Sep-2004
# Posted on: 05-Apr-2005 15:24:05   

Hi,

Also, at the moment you can't select a subset of the fields in an entity /view but this is added soon.

is it possible now to specify certain columns in the SELECT statement now? I couldnt find any information about this feature neither in the reference nor in this forum.

Florian

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 05-Apr-2005 15:49:24   

flo1227 wrote:

Hi,

Also, at the moment you can't select a subset of the fields in an entity /view but this is added soon.

is it possible now to specify certain columns in the SELECT statement now? I couldnt find any information about this feature neither in the reference nor in this forum. Florian

It was planned for the 1.0.2004.2 release but due to time restrictions it is moved to the may/june release. The main issue was a mapping designer which took too many time to write because a lot of more important things already took a lot of time.

Frans Bouma | Lead developer LLBLGen Pro