Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index on a view?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00499009
Message ID:
00499054
Views:
21
You do not have to invoke an Oracle index. As long as an index does exist in Oracle on the fields you will be filtering on, Oracle will use them to optimize an query you submit. The SQL for creating an index on an Oracle table:

create index I_CUSTOMER_LASTNAME on schema.CUSTOMER (LASTNAME) tablespace idx_tsname

I_CUSTOMER_LASTNAME is an arbitrary name for the index. A regular index is usually prefixed with I_ followed by the name of the table [CUSTOMER] and the column name [LASTNAME].

SCHEMA is the UserId under which the table exists [table owner].

The TABLESPACE IDX_TSNAME clause is optional. If not specified, the index is created in the same Oracle tablespace as the table being indexed.

A tablespace is an allocated space of contiguous blocks on the disk. This space is reserve explicitly for storing Oracle objects like tables, views, SPs, indexes, etc. When first created, the tablespace is empty with respect to what is being stored in it. However, the OS sees it as occupied disk space.

More on indexes. If you have specified a PK for the table, Oracle automatically has generated an index on the column[s] that comprise[s] the PK.

>I am embarking on unknown territory in creating a VFP front for a rather large Oracle database.
>
>When my form opens, I want it to be blank, and the user will then select one of four fields as criteria for a query. Then the query is sent to the database and retrieves one record for updating. The one record is fields from 8 or 9 tables with verious join conditions and is structured in a rather complicated view. several of the fields will be modifiable by the user and then I want to update the database with the additional or updated data.
>
>I use noDataOnLoad, and do not retrieve data until the query runs. In a VFP database I would have the four fields indexed and do a seek to locate the appropiate record. But views are not indexed, so must I somehow invoke the ORACLE index and search for the matching field, before executing the query?
>
>The question is how to retrieve that record without having to scan all these tables? I guess I am spoiled by indexdeek()
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform