Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

VIEW from VIEW

5 posts in General Discussion (old) Last posting was on 2008-09-19 11:52:40.0Z
Markus KARG Posted on 2008-09-03 12:12:08.0Z
From: "Markus KARG" <karg@quipsy.de>
Newsgroups: sybase.public.sqlanywhere
Subject: VIEW from VIEW
Lines: 13
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48be7f18@forums-1-dub>
Date: 3 Sep 2008 05:12:08 -0700
X-Trace: forums-1-dub 1220443928 10.22.241.152 (3 Sep 2008 05:12:08 -0700)
X-Original-Trace: 3 Sep 2008 05:12:08 -0700, vip152.sybase.com
X-Authenticated-User: panorama
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:148
Article PK: 866595

I have to write four nearly identical views that only vary in the GROUP BY
clause, while the rather long and complex FROM clause is always identical.
Since I am a lazy guy I do not want to write the long FROM again and again,
so my idea was to write another view that is consisting just from the FROM
clause, so the other four views will select from this "parent view".

My question is: What is the impact? Will that harm performance, or will it
be a win-win-situation (both, performance AND readbility will improve)?

Thanks!
Markus


"Frank Ploessel" <fpl... Posted on 2008-09-05 15:17:52.0Z
Subject: Re: VIEW from VIEW
From: "Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
References: <48be7f18@forums-1-dub>
Content-Transfer-Encoding: 7bit
Message-ID: <op.ug0kr1vtj0bybf@bonw00164.internal.imsglobal.com>
User-Agent: Opera Mail/9.21 (Win32)
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 5 Sep 2008 08:17:52 -0700
X-Trace: forums-1-dub 1220627872 10.22.241.152 (5 Sep 2008 08:17:52 -0700)
X-Original-Trace: 5 Sep 2008 08:17:52 -0700, vip152.sybase.com
Lines: 41
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:150
Article PK: 866596

Markus,

I would just try it:
Build view1, and based on it view2 with the group by, and then run a
select on view2, and check the graphical plan.
Then, put everything in one view view3, and run a select on that, looking
at the graphical plan.

Then compare both plans (maybe after running the same statement two times
to avoid differences in cache state, or after calling sa_flush_cache()
before ech call to start with an empty cache). This should show you if the
engine decides to go different paths for the different solutions.

While I would not expect that the two view solution would execute faster
than the one view solution, I also would not expect it to be much slower.
And if readibility is better and maintenance easier, that may be a good
reason to choose this solution.

Frank

On Wed, 03 Sep 2008 14:12:08 +0200, Markus KARG <karg@quipsy.de> wrote:

> I have to write four nearly identical views that only vary in the GROUP
> BY
> clause, while the rather long and complex FROM clause is always
> identical.
> Since I am a lazy guy I do not want to write the long FROM again and
> again,
> so my idea was to write another view that is consisting just from the
> FROM
> clause, so the other four views will select from this "parent view".
>
> My question is: What is the impact? Will that harm performance, or will
> it
> be a win-win-situation (both, performance AND readbility will improve)?
>
> Thanks!
> Markus
>
>


Markus KARG Posted on 2008-09-16 06:33:28.0Z
From: "Markus KARG" <karg@quipsy.de>
Newsgroups: sybase.public.sqlanywhere
References: <48be7f18@forums-1-dub> <op.ug0kr1vtj0bybf@bonw00164.internal.imsglobal.com>
Subject: Re: VIEW from VIEW
Lines: 53
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48cf5338@forums-1-dub>
Date: 15 Sep 2008 23:33:28 -0700
X-Trace: forums-1-dub 1221546808 10.22.241.152 (15 Sep 2008 23:33:28 -0700)
X-Original-Trace: 15 Sep 2008 23:33:28 -0700, vip152.sybase.com
X-Authenticated-User: panorama
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:156
Article PK: 866602

Comparing the plans is highly dependent on the actual database load. Since
we are an ISV, we only have nearly empty databases, while our customers have
huge data lods in different balances. So we are more interested in the pure
theory behind it.

Thanks
Markus

"Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m> schrieb im Newsbeitrag
news:op.ug0kr1vtj0bybf@bonw00164.internal.imsglobal.com...

> Markus,
>
> I would just try it:
> Build view1, and based on it view2 with the group by, and then run a
> select on view2, and check the graphical plan.
> Then, put everything in one view view3, and run a select on that, looking
> at the graphical plan.
>
> Then compare both plans (maybe after running the same statement two times
> to avoid differences in cache state, or after calling sa_flush_cache()
> before ech call to start with an empty cache). This should show you if the
> engine decides to go different paths for the different solutions.
>
> While I would not expect that the two view solution would execute faster
> than the one view solution, I also would not expect it to be much slower.
> And if readibility is better and maintenance easier, that may be a good
> reason to choose this solution.
>
> Frank
>
> On Wed, 03 Sep 2008 14:12:08 +0200, Markus KARG <karg@quipsy.de> wrote:
>
>> I have to write four nearly identical views that only vary in the GROUP
>> BY
>> clause, while the rather long and complex FROM clause is always
>> identical.
>> Since I am a lazy guy I do not want to write the long FROM again and
>> again,
>> so my idea was to write another view that is consisting just from the
>> FROM
>> clause, so the other four views will select from this "parent view".
>>
>> My question is: What is the impact? Will that harm performance, or will
>> it
>> be a win-win-situation (both, performance AND readbility will improve)?
>>
>> Thanks!
>> Markus
>>
>>
>


"Frank Ploessel" <fpl... Posted on 2008-09-19 11:52:40.0Z
Subject: Re: VIEW from VIEW
From: "Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m>
Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-15
MIME-Version: 1.0
Newsgroups: sybase.public.sqlanywhere
References: <48be7f18@forums-1-dub> <op.ug0kr1vtj0bybf@bonw00164.internal.imsglobal.com> <48cf5338@forums-1-dub>
Content-Transfer-Encoding: 7bit
Message-ID: <op.uhp8l1nkj0bybf@bonw01164.internal.imsglobal.com>
User-Agent: Opera Mail/9.51 (Win32)
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 19 Sep 2008 04:52:40 -0700
X-Trace: forums-1-dub 1221825160 10.22.241.152 (19 Sep 2008 04:52:40 -0700)
X-Original-Trace: 19 Sep 2008 04:52:40 -0700, vip152.sybase.com
Lines: 71
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:168
Article PK: 866614

Markus,

In theory, the optimizer should resolve both ways to the same execution
for all statements using the views.

Frank

Am 16.09.2008, 08:33 Uhr, schrieb Markus KARG <karg@quipsy.de>:

> Comparing the plans is highly dependent on the actual database load.
> Since
> we are an ISV, we only have nearly empty databases, while our customers
> have
> huge data lods in different balances. So we are more interested in the
> pure
> theory behind it.
>
> Thanks
> Markus
>
> "Frank Ploessel" <fpl...@d_e.i_m_s_h_e_a_l_t_h.c_o_m> schrieb im
> Newsbeitrag
> news:op.ug0kr1vtj0bybf@bonw00164.internal.imsglobal.com...
>> Markus,
>>
>> I would just try it:
>> Build view1, and based on it view2 with the group by, and then run a
>> select on view2, and check the graphical plan.
>> Then, put everything in one view view3, and run a select on that,
>> looking
>> at the graphical plan.
>>
>> Then compare both plans (maybe after running the same statement two
>> times
>> to avoid differences in cache state, or after calling sa_flush_cache()
>> before ech call to start with an empty cache). This should show you if
>> the
>> engine decides to go different paths for the different solutions.
>>
>> While I would not expect that the two view solution would execute faster
>> than the one view solution, I also would not expect it to be much
>> slower.
>> And if readibility is better and maintenance easier, that may be a good
>> reason to choose this solution.
>>
>> Frank
>>
>> On Wed, 03 Sep 2008 14:12:08 +0200, Markus KARG <karg@quipsy.de> wrote:
>>
>>> I have to write four nearly identical views that only vary in the GROUP
>>> BY
>>> clause, while the rather long and complex FROM clause is always
>>> identical.
>>> Since I am a lazy guy I do not want to write the long FROM again and
>>> again,
>>> so my idea was to write another view that is consisting just from the
>>> FROM
>>> clause, so the other four views will select from this "parent view".
>>>
>>> My question is: What is the impact? Will that harm performance, or will
>>> it
>>> be a win-win-situation (both, performance AND readbility will improve)?
>>>
>>> Thanks!
>>> Markus
>>>
>>>
>>
>
>


Breck Carter [sqlanywhere.blogspot.com] Posted on 2008-09-05 16:16:13.0Z
From: "Breck Carter [sqlanywhere.blogspot.com]" <NOSPAM__breck.carter@gmail.com>
Newsgroups: sybase.public.sqlanywhere
Subject: Re: VIEW from VIEW
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__breck.carter@gmail.com
Message-ID: <6nm2c41l47v4a4qg2g8uqjiqmbg36nlgan@4ax.com>
References: <48be7f18@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 5 Sep 2008 09:16:13 -0700
X-Trace: forums-1-dub 1220631373 10.22.241.152 (5 Sep 2008 09:16:13 -0700)
X-Original-Trace: 5 Sep 2008 09:16:13 -0700, vip152.sybase.com
Lines: 25
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.sqlanywhere:151
Article PK: 866597

I think views are really just a text-substitution thing, and the query
optimizer rewrites everything when you run a select, so go for it!

Breck

On 3 Sep 2008 05:12:08 -0700, "Markus KARG" <karg@quipsy.de> wrote:

>I have to write four nearly identical views that only vary in the GROUP BY
>clause, while the rather long and complex FROM clause is always identical.
>Since I am a lazy guy I do not want to write the long FROM again and again,
>so my idea was to write another view that is consisting just from the FROM
>clause, so the other four views will select from this "parent view".
>
>My question is: What is the impact? Will that harm performance, or will it
>be a win-win-situation (both, performance AND readbility will improve)?
>
>Thanks!
>Markus
>

--
Breck Carter http://sqlanywhere.blogspot.com/

RisingRoad SQL Anywhere and MobiLink Professional Services
breck.carter@risingroad.com