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.

does count use index ?

3 posts in General Discussion Last posting was on 2004-03-22 12:54:21.0Z
sen Posted on 2004-03-13 10:09:09.0Z
Sender: 7441.4052db50.1804289383@sybase.com
From: Sen
Newsgroups: ianywhere.public.general
Subject: does count use index ?
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <4052ddc5.7450.846930886@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 13 Mar 2004 02:09:09 -0800
X-Trace: forums-1-dub 1079172549 10.22.241.41 (13 Mar 2004 02:09:09 -0800)
X-Original-Trace: 13 Mar 2004 02:09:09 -0800, 10.22.241.41
Lines: 13
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2781
Article PK: 6252

I have table with 2,5 million row and has 1 indexed filed
name KD_Cust. If I
Select count(kd_cust) from MyTable Where kd_cust='ABC' Or
Select count() from MyTable Where kd_cust='ABC'
both of steatment need some time (around 5 sec) to display
the result. Am I miss something or there is something ought
to be done first before count() can work faster?
Is there any other way to display the result more faster?

If this issue already had been post before please direct me
to the previous post
TIA
Sen


Robert Waywell Posted on 2004-03-15 13:59:04.0Z
From: "Robert Waywell" <nospam_rwaywell@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4052ddc5.7450.846930886@sybase.com>
Subject: Re: does count use index ?
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: rwaywell-pc.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-pc.sybase.com
Message-ID: <4055b6a8$1@forums-1-dub>
Date: 15 Mar 2004 05:59:04 -0800
X-Trace: forums-1-dub 1079359144 10.25.100.187 (15 Mar 2004 05:59:04 -0800)
X-Original-Trace: 15 Mar 2004 05:59:04 -0800, rwaywell-pc.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2783
Article PK: 6253

What version and build number?
The answer to this question will let us direct you to the best place to
view the query plan to see exactly how the engine is processing the request.

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=B
ug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

<Sen> wrote in message news:4052ddc5.7450.846930886@sybase.com...
> I have table with 2,5 million row and has 1 indexed filed
> name KD_Cust. If I
> Select count(kd_cust) from MyTable Where kd_cust='ABC' Or
> Select count() from MyTable Where kd_cust='ABC'
> both of steatment need some time (around 5 sec) to display
> the result. Am I miss something or there is something ought
> to be done first before count() can work faster?
> Is there any other way to display the result more faster?
>
> If this issue already had been post before please direct me
> to the previous post
> TIA
> Sen


sen Posted on 2004-03-22 12:54:21.0Z
Sender: 731f.405ee19a.1804289383@sybase.com
From: Sen
Newsgroups: ianywhere.public.general
Subject: Re: does count use index ?
X-Mailer: WebNews to Mail Gateway v1.1s
Message-ID: <405ee1f9.7327.846930886@sybase.com>
References: <4052ddc5.7450.846930886@sybase.com><4055b6a8$1@forums-1-dub>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 22 Mar 2004 04:54:17 -0800, 10.22.241.42
Lines: 2
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Mar 2004 04:54:18 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Mar 2004 04:54:21 -0800
X-Trace: forums-1-dub 1079960061 10.22.108.75 (22 Mar 2004 04:54:21 -0800)
X-Original-Trace: 22 Mar 2004 04:54:21 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2813
Article PK: 6284

Thank, I somehow manage it. I'm using version 8