Re: Usage of Views
From: payyans (payyans_at_discussions.microsoft.com)
Date: 07/16/04
- Next message: Fie Fie Niles: "SQL Server 2000 and SQL Server 7"
- Previous message: Aaron [SQL Server MVP]: "Re: Performance degradation after changing data type"
- In reply to: Geoff N. Hiten: "Re: Usage of Views"
- Next in thread: Geoff N. Hiten: "Re: Usage of Views"
- Reply: Geoff N. Hiten: "Re: Usage of Views"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 08:28:02 -0700
When I created intermediary tables my process got completed in 10hours for 5million records, but, when changed to views it took 20hours. Can you please suggest any way to understand the details about the optimized query?
"Geoff N. Hiten" wrote:
> SQL should get this right. Those are treated same as derived columns and
> layering of views corresponds to a forced order of operations. I once wrote
> a commission calculation system using a lot of intermediate views, mainly to
> deal with grouping issues, and I never got a bogus calculation result.
>
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
>
> I support the Professional Association for SQL Server
> www.sqlpass.org
>
> "payyans" <payyans@discussions.microsoft.com> wrote in message
> news:B48C5A8F-DB2A-4DDF-A239-E4A2630CF8FF@microsoft.com...
> > Thanks for the info. Each view performs different complex arithmetic
> operations. Would there be any chance of optimizer applying the operations
> on wrong set of intermediary data?
> >
> > "payyans" wrote:
> >
> > > For a data analysis project, to avoid the creation of so many
> intermediary tables, I chose to CREATE VIEWS dynamically. Each VIEW becomes
> input to another CREATE VIEW. I have such 10 levels of Views. The execution
> plan of SELECT statement of the final view does not show any details of
> intermediary views.
> > >
> > > My question is that does SQL Server 2000 Enterprise Edition, optimize
> and generate the output for each VIEW in the order it was created, or does
> the optimizer re-write the entire query as a single query to create the
> final desired output?
> > >
> > >
>
>
>
- Next message: Fie Fie Niles: "SQL Server 2000 and SQL Server 7"
- Previous message: Aaron [SQL Server MVP]: "Re: Performance degradation after changing data type"
- In reply to: Geoff N. Hiten: "Re: Usage of Views"
- Next in thread: Geoff N. Hiten: "Re: Usage of Views"
- Reply: Geoff N. Hiten: "Re: Usage of Views"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|