dbTalk Databases Forums  

Is the execute plan the way which sybase actually execute the sql?

comp.databases.sybase comp.databases.sybase


Discuss Is the execute plan the way which sybase actually execute the sql? in the comp.databases.sybase forum.



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

Default Is the execute plan the way which sybase actually execute the sql? - 01-06-2011 , 11:43 PM






I am using sybase sql advantage. There is a non-cluester index with
columns(idc1, idc2) in the table.

SELECT c3, c4, c5
FROM the_table
WHERE idc1=10000
AND idc2=20000

Below is the execute plan of the SQL

STEP 1
The type of query is INSERT.
The update mode is direct.
Worktable1 created, in allpages locking mode, for DISTINCT.


FROM TABLE
the_table

Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 16 Kbytes for data pages.
With MRU Buffer Replacement Strategy for data pages.
TO TABLE
Worktable1.

STEP 2
The type of query is SELECT.
This step involves sorting.


FROM TABLE
Worktable1.
Using GETSORTED
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 16 Kbytes for data pages.
With MRU Buffer Replacement Strategy for data pages.



Why this SQL don't use index? What should I do to use an index for
this SQL?

Reply With Quote
  #2  
Old   
joeNOSPAM@BEA.com
 
Posts: n/a

Default Re: Is the execute plan the way which sybase actually execute the sql? - 01-09-2011 , 03:29 PM






How many rows are in the table, and how big is each row?
If the whole table fits on 2 16k pages, it's as fast or faster
to read in both pages and scan them, than it would be
to read in an index page an then perhaps have to still read
in both data pages.

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.