hi, we are using db2 udb v8.1 on windows, i have a table contains over
one million records, it has seperate own tablespace than others, with
bufferpool size 250, i have created multiple views on this table , the
problem is some of the views have omit infomation like this one :
where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not (
OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and
( not ( OEQY02=+0)) and ( not ( OECD47='C')) and ( not (
OECD47='V')) and ( not ( OECD04='N')) and ( not ( OECD01='D')), so
even though the view with the where condition has zero records, it
takes me a 2,3 minutes to come up when i do sample data, so my
question is is there anyway come up the query faster? is the db2
determine the data based on the where condition on the run time?
thanks 8 3597
xixi wrote: hi, we are using db2 udb v8.1 on windows, i have a table contains over one million records, it has seperate own tablespace than others, with bufferpool size 250, i have created multiple views on this table , the problem is some of the views have omit infomation like this one : where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not ( OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and ( not ( OEQY02=+0)) and ( not ( OECD47='C')) and ( not ( OECD47='V')) and ( not ( OECD04='N')) and ( not ( OECD01='D')), so even though the view with the where condition has zero records, it takes me a 2,3 minutes to come up when i do sample data, so my question is is there anyway come up the query faster? is the db2 determine the data based on the where condition on the run time? thanks
Views are not materialized, so each query to the view gets materialized
at runtime. You can pre-compute the results by building a materialized
query table (MQT).
A couple of other notes:
You can rewrite your predicate to simplify:
where OECD09 not in ('A','K','C','G ','S')
and OECD47 not in ('C','V')
and OECD40 <> 'N'
and OECD01 <> 'D'
and OEQY02 <> 0
If this is is performing poorly, consider your index design, statistics,
etc.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
xixi wrote: hi, we are using db2 udb v8.1 on windows, i have a table contains over one million records, it has seperate own tablespace than others, with bufferpool size 250, i have created multiple views on this table , the problem is some of the views have omit infomation like this one : where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not ( OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and ( not ( OEQY02=+0)) and ( not ( OECD47='C')) and ( not ( OECD47='V')) and ( not ( OECD04='N')) and ( not ( OECD01='D')), so even though the view with the where condition has zero records, it takes me a 2,3 minutes to come up when i do sample data, so my question is is there anyway come up the query faster? is the db2 determine the data based on the where condition on the run time? thanks
Views are not materialized, so each query to the view gets materialized
at runtime. You can pre-compute the results by building a materialized
query table (MQT).
A couple of other notes:
You can rewrite your predicate to simplify:
where OECD09 not in ('A','K','C','G ','S')
and OECD47 not in ('C','V')
and OECD40 <> 'N'
and OECD01 <> 'D'
and OEQY02 <> 0
If this is is performing poorly, consider your index design, statistics,
etc.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
xixi wrote: hi, we are using db2 udb v8.1 on windows, i have a table contains over one million records, it has seperate own tablespace than others, with bufferpool size 250, i have created multiple views on this table , the problem is some of the views have omit infomation like this one : where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not ( OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and ( not ( OEQY02=+0)) and ( not ( OECD47='C')) and ( not ( OECD47='V')) and ( not ( OECD04='N')) and ( not ( OECD01='D')), so even though the view with the where condition has zero records, it takes me a 2,3 minutes to come up when i do sample data, so my question is is there anyway come up the query faster? is the db2 determine the data based on the where condition on the run time? thanks
Do you have indexes on the OECDxx colums?
You could also try to rephrase the WHERE clause like this:
WHERE oecd09 NOT IN ( 'A', 'K', 'C', 'G', 'S' ) AND
oeqy <> 0 AND
oecd47 NOT IN ( 'C', 'V' ) AND
oecd04 <> 'N' AND
oecd01 <> 'D'
--
Knut Stolze
Information Integration
IBM Germany / University of Jena
xixi wrote: hi, we are using db2 udb v8.1 on windows, i have a table contains over one million records, it has seperate own tablespace than others, with bufferpool size 250, i have created multiple views on this table , the problem is some of the views have omit infomation like this one : where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not ( OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and ( not ( OEQY02=+0)) and ( not ( OECD47='C')) and ( not ( OECD47='V')) and ( not ( OECD04='N')) and ( not ( OECD01='D')), so even though the view with the where condition has zero records, it takes me a 2,3 minutes to come up when i do sample data, so my question is is there anyway come up the query faster? is the db2 determine the data based on the where condition on the run time? thanks
Do you have indexes on the OECDxx colums?
You could also try to rephrase the WHERE clause like this:
WHERE oecd09 NOT IN ( 'A', 'K', 'C', 'G', 'S' ) AND
oeqy <> 0 AND
oecd47 NOT IN ( 'C', 'V' ) AND
oecd04 <> 'N' AND
oecd01 <> 'D'
--
Knut Stolze
Information Integration
IBM Germany / University of Jena
the where clause is automatically generated by program, i can't change
that to you described, unless manually, i have done indexes suggested
by db2 already, and do run statistics too.
the where clause is automatically generated by program, i can't change
that to you described, unless manually, i have done indexes suggested
by db2 already, and do run statistics too.
i have tried to change the where clause as you described, run stat,
and create the index as db2 design advisor recommend, but still not
much improvment on the query from the view, anything else could help?
thanks
Views are not materialized, so each query to the view gets materialized at runtime. You can pre-compute the results by building a materialized query table (MQT).
A couple of other notes:
You can rewrite your predicate to simplify:
where OECD09 not in ('A','K','C','G ','S') and OECD47 not in ('C','V') and OECD40 <> 'N' and OECD01 <> 'D' and OEQY02 <> 0
If this is is performing poorly, consider your index design, statistics, etc.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
"xixi" <da****@yahoo.c om> wrote in message
news:c0******** *************** ***@posting.goo gle.com... i have tried to change the where clause as you described, run stat, and create the index as db2 design advisor recommend, but still not much improvment on the query from the view, anything else could help? thanks
Views are not materialized, so each query to the view gets materialized at runtime. You can pre-compute the results by building a materialized query table (MQT).
A couple of other notes:
You can rewrite your predicate to simplify:
where OECD09 not in ('A','K','C','G ','S') and OECD47 not in ('C','V') and OECD40 <> 'N' and OECD01 <> 'D' and OEQY02 <> 0
If this is is performing poorly, consider your index design, statistics, etc.
Please show the index DDL for all the indexes on the table(s) in the query. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: js |
last post by:
I am trying to create a primary key constraint on a view in the
following statement. However, I got an error ORA-00907: missing right
parenthesis. If the CONSTRAINT clause is removed, then the view is
created fine. Does anyone know how to creat Primary Key Constraint
for a View? Thanks.
CREATE OR REPLACE VIEW RPT_VW_WMN (
CARD, EC_D_CODE, EC_M_CODE,
START_DATE, PR_NAME, PR_ID, ELIG, ANNUALY, MONTHLY, PENDING,
/* ORA-00907: missing...
|
by: sci |
last post by:
Could someone help me by answering the questions below?
What's a cursor?
What's difference between Query and View?
Is a RecordSet just part of a table? Can it be part of a query of view?
If the content in a table changed, is it necessary for a old recordset to
renew itself by do "Requery()"?
Thanks for your help!
|
by: brendan_gallagher_2001 |
last post by:
Hi,
I have a view(A) and I am trying to do a join on another table (B) to
include only rows where date values in view A is greater than in table
B. I also want the view to pick up rows in viewA based on date values.
Here is what I have so far:
SELECT *
FROM viewA vw
left JOIN tableB tb ON
|
by: xixi |
last post by:
hi, we are using db2 udb v8.1 on windows, i have a table contains over
one million records, it has seperate own tablespace than others, with
bufferpool size 250, i have created multiple views on this table , the
problem is some of the views have omit infomation like this one :
where ( not (OECD09='A')) and ( not ( OECD09='K')) and ( not (
OECD09='C')) and ( not ( OECD09='G')) and ( not ( OECD09='S')) and
( not ( OEQY02=+0)) and ( not...
|
by: xixi |
last post by:
when i create a join view like this
create view JV104FZ.APJTINM1 (APAM32, APNO20, APQY05, PONO01, PONO05,
PONO19, POCD01, POCD13, systimestamp, loginname, id ) as select
JV104FZ.APPTINM.APAM32, JV104FZ.APPTINM.APNO20,
JV104FZ.APPTINM.APQY05, JV104FZ.APPTINM.PONO01,
JV104FZ.APPTINM.PONO05, JV104FZ.APPTINM.PONO19,
COALESCE(JV104FZ.POPTOL.POCD01, ' '), COALESCE(JV104FZ.POPTOL.POCD13,
' '), JV104FZ.POPTOL.systimestamp,...
| |
by: Sathyaram Sannasi |
last post by:
I'm testing a UNION ALL View (say UA_VIEW) of 12 tables - one table for
each year - 5 million records/table on an average.
Check constraints are defined on the base table -
EG. EFF_START_DATE BETWEEN ('2004-01-01' AND '2004-12-31') AND
EFF_END_DATE BETWEEN ('2004-01-01' and '2004-12-31')
and also on the view defn,
|
by: sasan3 |
last post by:
when I set visible=false, then entry is not visible in form view, but
still shows up in datasheet view. How do I make a field not to show
based on some condition in datasheet view?
Tx.
|
by: Bethany Holliday |
last post by:
Hi All,
I'm hoping someone can help me. I think I'm missing something very
basic. I'm trying to put a clustered index on a view that I have
created. I keep getting the error:
Server: Msg 8668, Level 16, State 1, Line 1
An index cannot be created on the view 'cew_avwage_uscnty' because the
select list of the view contains a non-aggregate expression.
|
by: JayCallas |
last post by:
I have a SQL 2000 table containing 2 million rows of Trade data. Here
are some of the columns:
INT IDENTITY(1,1) -- PK, non-clustered
DATETIME -- clustered index
DATETIME -- non-clustered index
VARCHAR(10)
VARCHAR(10)
INT
etc..
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |