473,788 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query plan / table partitioning

I have set up a test table with range partitioning. The partitions
are by date (recdate):
1) Pre-2004
2) 2004
3) 2005
4) 2006
5) 2007
6) 2008

When executing the query: select * from analysis_data where
year(recdate) = 2006, I would expect that the query plan would utilize
only the partition with 2006 data. However, it seems to do a TBSCAN
across the entire table.

There are no indexes setup on the table. DB2 Version 9.1 fp 4a
Aug 27 '08 #1
2 3816
On Aug 27, 11:07*pm, Justin <kfw...@hotmail .comwrote:
I have set up a test table with range partitioning. *The partitions
are by date (recdate):
1) Pre-2004
2) 2004
3) 2005
4) 2006
5) 2007
6) 2008

When executing the query: select * from analysis_data where
year(recdate) = 2006, I would expect that the query plan would utilize
only the partition with 2006 data. *However, it seems to do a TBSCAN
across the entire table.

There are no indexes setup on the table. *DB2 Version 9.1 fp 4a
Don't know about this, but just an idea: A one-dimensional MDC would
cost almost no space and stop DB2 from scanning the whole table.
Aug 30 '08 #2
On Aug 27, 2:07*pm, Justin <kfw...@hotmail .comwrote:
I have set up a test table with range partitioning. *The partitions
are by date (recdate):
Did you partition by date (i.e., date between '2005-01-01' and
'2005-12-31' or by YEAR(date) = 2005?
-Chris
Sep 8 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4522
by: Mahesh Hardikar | last post by:
Hi , Oracle 8.1.7.0.0 on HP-UX 11.0 I am a newbie as far as PL-SQL is concerned . I have Sybase/MSSQL T-SQL background. We have a report which uses a select statement . This select statement joins 15 tables . SOme of the tables are outer joined. It runs much slow when parameters (From & To Date) are for a month.
1
1478
by: Peder Bacher | last post by:
Hello :-) My question is: If I query a partitioned view, but don't know the values in the "where x in(<expression>)" clause, i.e.: select * from viewA where intVal in(select intVal from tbl1) . Compared to: select * from viewA where intVal in(5,6). Of course "intVal" is partitioning column. Will this result in an optimized query that searches only the relevant tables?
0
1456
by: apb18 | last post by:
A bit of query plan strangeness. Suppose you have an inheritance tree such that the columns 'ID' and 'field' appear in the top level table, call that table XXX. tables YYY and ZZZ both inherit XXX. Now suppose there exists some query that returns a set of IDs that match some criteria (that query may involve various tests/joins/etc on other arbitrary tables). Executing that query alone produces an optimal plan and the exact result set...
8
3271
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run simultaneously 4 similar queries it takes nearly 5 minutes instead of 4 times 9 seconds or something near of that. here is a sample query: select mertido, fomeazon, ertektipus, mertertek from t_me30 where fomeazon in (select distinct fomeazon...
6
2047
by: Jack Orenstein | last post by:
Suppose I have a table as follows: testdb=> \d person Table "public.person" Column | Type | Modifiers ------------+-------------------------+----------- id | integer | not null age | integer | other_info | character varying(1000) | Indexes: person_pkey primary key btree (id),
7
2216
by: stig | last post by:
hi. coming from postgresql, i am used to textual references to most of the things i do with the database. i feel a little lost with all the graphical. i have few questions regarding MS SQL 2000 1. what is the best (or easiest) way of getting a table definition in text? it could be either a CREATE TABLE sql-query or a just a definition, something like: TABLE thisTable id integer
4
2857
by: db2admin | last post by:
hi, For the following SQL and plan ============================================================== SELECT Q1.PLCY_KY, Q1.PLCY_TRM_EFCTV_DT, Q1.ACNTG_BGN_DT, CASE WHEN ((Q1.PLCY_SRC_CD = '02') AND ((DAYS(Q1.PLCY_TRM_EXPRTN_DT) - DAYS(Q1.PLCY_TRM_EFCTV_DT)) <= 180)) THEN 'Y'
3
1370
by: Sam Durai | last post by:
Here is a small testcase of the problem which I'm facing in prod env. db2 =describe table tab1 Column Type Type name schema name Length Scale Null ------------------------------ --------- ------------------ -------- ----- ----
10
2206
by: Raj | last post by:
I have an MDC index on Big_A.Dt column. The following query always goes for a table scan. SELECT Key, Cd, Dt, SUM(Big_A ) FROM ( SELECT Big_A.Key , small_3.Cd,
0
9656
marktang
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...
0
9498
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,...
0
10366
Oralloy
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...
0
10173
jinu1996
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...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6750
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();...
1
4070
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
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.