Subject: Indexing and arrays

From: [email-masked] (Steve Davidson)
Date: Fri, 18 Jun 93 09:09:05 -0700

Can an index be placed on an array?

I'd like to know if an index placed on an array field
applies to each element of the array.  For instance:

create TEST (words=text[])
append TEST (words="{fruit, orange, citrus}")
append TEST (words="{apple}")
define index i_words on TEST
	using btree (words text_ops)

retrieve (TEST.all) where words=orange

---Firstly, the define index fails:
DefineIndex: attribute "words" not found

---Second, I don't think the retrieve would have worked even if
   the define had worked.  Notice I did not say "words[n]", just 
   "words".

I need a variable length text field with an index on each element
of the array.  Does anybody know how to do this?

              --------======= * =======--------
                       Steven Davidson
                       [email-masked]

---

From: [email-masked] (Steve Davidson)
Date: Fri, 18 Jun 93 15:39:35 -0700

: From [email-masked] Fri Jun 18 13:58:24 1993
: To: [email-masked] (Steve Davidson)
: Subject: Re: Indexing and arrays 
: Date: Fri, 18 Jun 1993 11:32:10 -0700
: From: Mike Olson <[email-masked]>
: Content-Length: 228
: 
: [email-masked] (Steve Davidson) writes:
: 
: > Can an index be placed on an array?
: 
: no, but if you have a function that takes an array as an argument,
: you can define an index on the result of the function.
: 
: 					mike
: 
Can I use this to cause an index to be placed on each element of an
array?  What would the query look like