dbTalk Databases Forums  

query running time and others..

comp.databases.sybase comp.databases.sybase


Discuss query running time and others.. in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JZ
 
Posts: n/a

Default query running time and others.. - 05-12-2004 , 02:23 PM






Hi all,

In isql, how do I know the exec time for a given query? (like 'set
timing on' in Oracle)

Also, generally speaking, in Oracle, people create index on different
tablespaces from table tablespace. In Sybase, I guess this should be
the same (for performance purpose). How can I specify a different
database for a primary key at the time when I create table? (one
single SQL)

Thanks a lot!

Reply With Quote
  #2  
Old   
Mark A. Parsons
 
Posts: n/a

Default Re: query running time and others.. - 05-12-2004 , 03:36 PM






JZ wrote:
Quote:
In isql, how do I know the exec time for a given query? (like 'set
timing on' in Oracle)
set statistics time on

Although this may not give you what you're expecting ... if you want
wall-clock time you'd need to do something like:

select @begin_time = getdate()
exec-some-squery
select @wall_clock_time = datediff(ss,@begin_time,getdate())

Quote:
Also, generally speaking, in Oracle, people create index on different
tablespaces from table tablespace. In Sybase, I guess this should be
the same (for performance purpose). How can I specify a different
database for a primary key at the time when I create table? (one
single SQL)
In Sybase you'll want to look at creating the index on a different segment
from where the data resides. Just a couple caveats ...

- a clustered index has as leaf pages the actual data pages, ie, the
clustered index and data will always reside on the same segment

- in order to gain the max (performance) benefit of putting indices on
different (from data) segments ... said index segments should reside on
different disk fragments (from data) and said disk fragments should be part
of physically distinct disks

Some info on Sybase 'hierarchy' ...

dataserver - contains many databases; Sybase devices (links to OS raw/file
devices) are created at the dataserver level

database - contained within a dataserver; logical collection of related
data; created from Sybase devices, may use all or part of a device, may
span multiple devices

segment - logical collection of space within a database; all databases are
initially created with 'default', 'system' and 'logsegment' segments; users
can create their own segments; the relationship between segments and the
device fragments that make up a database can be 1:many, many:1 and
many:many.

--
Mark A. Parsons

Iron Horse, Inc.
iron_horse (AT) NOSPAM (DOT) compuserve.com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.