If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Views not using Indexes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-07-05, 07:49
Lemm Lemm is offline
Registered User
 
Join Date: Mar 2005
Posts: 3
Views not using Indexes

Hi all,

just wondered if anyone would be able to shed any light on an issue we are currently having.

We have 2 tables which we union using a view. Selecting information from this view is fine, and indexes on the underlying tables is used correctly.

For example:

Select v.*
From View v
Where v.id = x

However, if we need to join with another table table, the optimizer seems to be creating a temporary table and then sequentially scanning.

For example:

Select v.*, o.*
From View v, Other o
Where v.id = o.id
And o.id = x

This is causing our queries to take a long time to complete due to the size of the table being created by the view (3 million records).

Any help appreciated!
Reply With Quote
  #2 (permalink)  
Old 12-11-05, 14:12
RobP RobP is offline
Registered User
 
Join Date: Mar 2004
Location: Netherlands
Posts: 183
Hi Lemm,

Are you sure there are statistics available on the table under the view. If this isn't solving the problem please sen din info like exact version and both access paths.

Hope ths helps,

Rob
Reply With Quote
  #3 (permalink)  
Old 12-12-05, 06:38
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi,
Please, take the SQL that generates the view and runs this with set explain on.

Gustavo.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On