My motivation is that I develop an ASP.NET solution and almost all my buisness logic is structured as a Composite pattern. That means that I make a lot of select queries to the database (one for each class and subclass). While I don't close the connection between these request (that cut the request time down by a factor of 3) I still feel it should be tuned a little. Batch select is the most obvious one.

On 11/1/06, Dean Harding <[EMAIL PROTECTED]> wrote:
> > |string sql =
> >   "Select * from Tbl_Lu_Priorities Order By PriorityTitle;
> >
> >   Select * from Tbl_Lu_Statuses Order By Status;
> >   Select * from Tbl_Ma_Users Order By Username;";
> >
> > DataSet ds = new DataSet();
> > FbDataAdapter cnAdapter = new FbDataAdapter(sql, cnConnection)
> > cnAdapter(ds);
>
> If selects returning same type of columns (it should, if you're using one
> dataset) then you can use union keyword.
>
> Else no, it doesn't make any sence.

It makes perfect sense, the exact same query would work as expected (i.e.
you'd get three DataTables inside your DataSet) on SQL Server.

It would only provide (noticeable) benefit if you're running Firebird in
server mode, though. Executing your query like that, rather than three
separate command would save you the round-trip to the database (which can be
in the order of a few milliseconds). Obviously, though, if you're running an
embedded database, there'd be little difference.

I don't know if Firebird supports it in either server or embedded mode,
though.

Dean.



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to