Hi,
Has anyone got problem with this on large table. It seems it take ages to return the result ( half an hour :-( ).
SELECT COUNT(*) FROM COORDINATE
A strange thing is the tempory space (System Managed) keeps growing during the query:
14346747904 Dec 2 16:22 SQL00002.TDA
It's almost as large as the current table (17GB). Any comments?
Many thanks,
Bing 12 39689
Bing Wu wrote: Hi,
Has anyone got problem with this on large table. It seems it take ages to return the result ( half an hour :-( ).
SELECT COUNT(*) FROM COORDINATE
A strange thing is the tempory space (System Managed) keeps growing during the query:
14346747904 Dec 2 16:22 SQL00002.TDA
It's almost as large as the current table (17GB). Any comments?
Many thanks,
Bing
try:
select count(1) from ...
and see.
hth.
Wolfgang
Many thanks for the hint. It seems still taking long time.
Bing
Wolfgang Riedel wrote: try:
select count(1) from ...
and see.
hth. Wolfgang
>Has anyone got problem with this on large table. It seems it take ages to return the result ( half an hour :-( ).
SELECT COUNT(*) FROM COORDINATE
have you ran explain ? maybe an index would help
Is there any index for the table?
Maybe you should reorg the TS and Indexspace to optimize it.
Form the result count, it's a huge table, if it's not well orgnized, it'll
need a long time to get a result of course.
"Bing Wu" <bi**@biop.ox.a c.uk> wrote in message
news:bq******** **@news.ox.ac.u k... Hi,
Has anyone got problem with this on large table. It seems it take ages to
return the result ( half an hour :-( ). SELECT COUNT(*) FROM COORDINATE
A strange thing is the tempory space (System Managed) keeps growing during
the query: 14346747904 Dec 2 16:22 SQL00002.TDA
It's almost as large as the current table (17GB). Any comments?
Many thanks,
Bing
Bing Wu wrote: Hi,
Has anyone got problem with this on large table. It seems it take ages to return the result ( half an hour :-( ).
SELECT COUNT(*) FROM COORDINATE
A strange thing is the tempory space (System Managed) keeps growing during the query:
14346747904 Dec 2 16:22 SQL00002.TDA
It's almost as large as the current table (17GB). Any comments?
Many thanks,
Bing
Are you certain that COORDINATE is a table and not a view? Normally
a simple query like this should not require any temp space. As someone
already mentioned in this thread, get an explain for the query. Once
you do, post it here, maybe someone will be able to help you then.
Regards,
Miro
Yes, it's a table with over a billion rows. I have run the SQL explain and please find the result below.
Thanks again,
Bing
Package Name = "DB2ADMIN"."DYN EXPLN" Version = ""
Prep Date = 2003/12/04
Prep Time = 15:36:33
Bind Timestamp = 2003-12-04-15.36.33.960521
Isolation Level = Cursor Stability
Blocking = Block Unambiguous Cursors
Query Optimization Class = 7
Partition Parallel = No
Intra-Partition Parallel = Yes (Bind Degree = ANY)
SQL Path = "SYSIBM", "SYSFUN", "SYSPROC", "DB2ADMIN"
-------------------- SECTION ---------------------------------------
Section = 1
SQL Statement:
DECLARE C1 CURSOR
FOR
SELECT COUNT(*)
FROM COORDINATE
Intra-Partition Parallelism Degree = 2
Section Code Page = 819
Estimated Cost = 8889258.000000
Estimated Cardinality = 1.000000
Process Using 2 Subagents
| Access Table Name = DB2ADMIN.COORDI NATE ID = 4,4
| | #Columns = 0
| | Parallel Scan
| | Relation Scan
| | | Prefetch: Eligible
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
| | Sargable Predicate(s)
| | | Partial Predicate Aggregation
| | | | Column Function(s)
| Partial Aggregation Completion
| | Column Function(s)
| Insert Into Asynchronous Local Table Queue ID = q1
Access Local Table Queue ID = q1 #Columns = 1
Final Aggregation
| Column Function(s)
Return Data to Application
| #Columns = 1
End of section
miro flasza wrote: Are you certain that COORDINATE is a table and not a view? Normally a simple query like this should not require any temp space. As someone already mentioned in this thread, get an explain for the query. Once you do, post it here, maybe someone will be able to help you then.
Regards, Miro
Yes, it's indexed and organised. I'll try the reorg and see if it improves.
Thanks,
Bing
Jing Li wrote: Is there any index for the table? Maybe you should reorg the TS and Indexspace to optimize it. Form the result count, it's a huge table, if it's not well orgnized, it'll need a long time to get a result of course.
Bing Wu,
do you have any indexes on the table at all?
Have you run reorgchk?
Likely unrelated, but what happens if you do a select count_big(*)
against the table? Have you done a runstats on the table? Runstats on
its indexes? Can you define a unique index on it (sorry if you'd heard
these sugggestions before)?
Bing Wu wrote: Yes, it's indexed and organised. I'll try the reorg and see if it improves.
Thanks,
Bing
Jing Li wrote:
Is there any index for the table? Maybe you should reorg the TS and Indexspace to optimize it. Form the result count, it's a huge table, if it's not well orgnized, it'll need a long time to get a result of course. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Fatt Shin |
last post by:
Hi,
I'm running MySQL 4.0.13, connecting from PowerBuilder 9 using ODCB
Connector 3.51.
I'm facing a problem where whenever I issue a SELECT COUNT(*) statement
from PowerBuilder, I always get SQL syntax error back from MySQL. (Refer
to ODBC Trace I captured below).
metrohouse af8-b94 ENTER SQLExecDirect
HSTMT 014D2360
UCHAR * 0x020A0EA2 "select count ( *) from code
|
by: TGOS |
last post by:
Here's a little question to MySQL Gurus.
Two tables. One called 'document' one called 'page'. Needles to say, a
document consist out of multiple pages (1:n). The primary (P) and
foreign (F) keys are:
*** document
document_id (P)
|
by: MP |
last post by:
vb6,ado,mdb,win2k
i pass the sql string to the .Execute method on the open connection to
Table_Name(const) db table
fwiw
(the connection opened via class wrapper:)
msConnString = "Data Source=" & msDbFilename
moConn.Properties("Persist Security Info") = False
moConn.ConnectionString = msConnString
moConn.CursorLocation = adUseClient
moConn.Mode = adModeReadWrite' or using default...same result
|
by: zafm86 |
last post by:
Hi everyone!
I'm sure my problem is pretty easy to solve but I've been working on it for a long and my my brain is not working correctly anymore.
I'm working with an AS400 and I mhave to do an "interface" in Access. It's like a little system to make a production plan. It must get information about part numbers, description, set where the part number belongs, quantity of part numbers that the set uses, stock number(this is a text value, it...
|
by: Hasse1982 |
last post by:
Hi
I have a table KDOCUMENT with the columns
,
,
,
,
,
,
| |
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: 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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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...
| |