Subject Re: [firebird-support] Re: Simple Performance question
Author Robert martin
Thanks Adam

Thats just what I wanted to hear ! One sql is also better for coding
purposes to, so its a winner in every way :)


Rob Martin
Software Engineer

phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com

Wild Software Ltd



Adam wrote:
> UNION does a 'DISTINCT' operation on the two sets of data that have
> been brought together. Not that sorting two records is going to be a
> measurable overhead, but UNION ALL avoids this sorting.
>
> The direct answer to your question is that there is more overhead if
> you issue it as two separate queries (more round trips to the server).
> If you convert it to a stored procedure, the plan gets cached, so it
> becomes even cheaper.
>
> Adam
>
>
>
>