Changes between Initial Version and Version 1 of FdoIndexingApis


Ignore:
Timestamp:
Jun 18, 2009, 1:56:30 AM (15 years ago)
Author:
jng
Comment:

Some ideas about indexing

Legend:

Unmodified
Added
Removed
Modified
  • FdoIndexingApis

    v1 v1  
     1
     2== FDO Indexing APIs ==
     3
     4=== Overview ===
     5
     6A common data store concept that has yet to be exposed in FDO is indexes. Nearly all databases (spatial or non-spatial), have some form of indexing capability available, however this indexing has to be done outside of FDO as no interface currently exists to do this through FDO. For the purposes of this discussion, we are mainly referring to property (attribute) indexes and not spatial indexes.
     7
     8It would make sense for FDO to support the ability to create custom indexes. Perhaps the best way to expose such an interface would be to model it in the exact same way that Spatial Contexts are managed. So something like
     9
     10=== Possible Interfaces ===
     11
     12New Command Types:
     13{{{
     14FdoCommandType_CreateIndex
     15FdoCommandType_GetIndexes
     16FdoCommandType_DestroyIndex
     17}}}
     18
     19FdoICreateIndex:
     20{{{
     21/// \brief
     22/// Defines the CreateIndex command, which creates an index on the current
     23/// data store
     24class FdoICreateIndex : public FdoICommand
     25{
     26public:
     27    /// \brief
     28    ///  Gets the name of the index to create
     29    ///
     30    /// \return
     31    /// Returns the name of the index
     32    ///
     33    FDO_API virtual FdoString* GetName() = 0;
     34
     35    /// \brief
     36    ///  Sets the name of the index to create
     37    ///
     38    FDO_API virtual void SetName(const FdoString* value) = 0;
     39
     40    /// \brief
     41    ///  Gets the name of the class definition to create this index on
     42    ///
     43    /// \return
     44    /// Returns the name of the class
     45    ///
     46    FDO_API virtual FdoString* GetClassName() = 0;
     47
     48    /// \brief
     49    ///  Sets the name of the class definition to create this index on
     50    ///
     51    FDO_API virtual void SetClassName(const FdoString* className) = 0;
     52
     53    /// \brief
     54    ///  Gets the collection of property names this index will be created on
     55    ///
     56    /// \return
     57    /// Returns the collection of property names
     58    ///
     59    FDO_API virtual FdoStringCollection* GetPropertyNames() = 0;
     60
     61    /// \brief
     62    ///  Sets a boolean flag that indicates how the CreateIndex command will behave
     63    /// if the named index already exists.
     64    FDO_API virtual void SetUpdateExisting(const bool value) = 0;
     65
     66    /// \brief
     67    ///  Gets a boolean flag that indicates how the CreateIndex command will behave
     68    /// if the named index already exists.
     69    ///
     70    /// \return
     71    /// Returns true if command should update existing index
     72    ///
     73    FDO_API virtual bool GetUpdateExisting() = 0;
     74
     75    /// \brief
     76    ///  Executes the command
     77    ///
     78    FDO_API virtual void Execute() = 0; 
     79};
     80}}}
     81
     82FdoIDestroyIndex:
     83{{{
     84/// \brief
     85/// Defines the DestroyIndex command, which destroys an existing index. Input to the
     86/// command is the name of the index to destroy.
     87class FdoIDestroyIndex : public FdoICommand
     88{
     89public:
     90    /// \brief
     91    ///  Gets the name of the index to destroy
     92    ///
     93    /// \return
     94    /// Returns the name of the index
     95    ///
     96    FDO_API virtual FdoString* GetName() = 0;
     97
     98    /// \brief
     99    ///  Sets the name of the index to destroy
     100    ///
     101    FDO_API virtual void SetName(FdoString* value) = 0;
     102
     103    /// \brief
     104    ///  Executes the command
     105    ///
     106    FDO_API virtual void Execute() = 0;
     107};
     108}}}
     109
     110FdoIGetIndexes:
     111{{{
     112/// \brief
     113/// Defines the GetIndexes command, which enumerates the existing indexes
     114class FdoIGetIndexes: public FdoICommand
     115{
     116public:
     117    /// \brief
     118    ///  Executes the command returning an FdoIIndexReader
     119    ///
     120    FDO_API virtual FdoIIndexReader Execute() = 0; 
     121};
     122}}}
     123
     124FdoIIndexReader:
     125{{{
     126/// \brief
     127/// Provides a forward-only, read-only iterator for reading data store indexes
     128/// A reference to an FdoIIndexReader is returned from the GetIndexes commands.
     129/// Because the initial position of the FdoIIndexReader is prior to the first item,
     130/// you must call ReadNext to begin acessing any data
     131class FdoIIndexReader: public FdoIDisposable
     132{
     133public:
     134    /// \brief
     135    /// Gets the name of the index currently being read
     136    ///
     137    /// \return
     138    /// Returns the name of the index
     139    ///
     140    FDO_API virtual FdoString* GetName() = 0;
     141
     142    /// \brief
     143    /// Gets the name of the feature schema this current index is being applied to
     144    ///
     145    /// \return
     146    /// Returns the name of the feature schema
     147    ///
     148    FDO_API virtual FdoString* GetSchemaName() = 0;
     149
     150    /// \brief
     151    /// Gets the name of the class definition this current index is being applied to
     152    ///
     153    /// \return
     154    /// Returns the name of the class definition
     155    ///
     156    FDO_API virtual FdoString* GetClassName() = 0;
     157
     158    /// \brief
     159    /// Gets the names of the properties this current index is being applied to
     160    ///
     161    /// \return
     162    /// Returns a collection of property names
     163    ///
     164    FDO_API virtual FdoStringCollection* GetPropertyNames() = 0;
     165
     166    /// \brief
     167    /// Advances the reader to the next item. The default position of the reader
     168    /// is prior to the first item. Thus, you must call ReadNext to begin
     169    /// accessing any data.
     170    ///
     171    /// \return
     172    /// Returns true if there is a next item.
     173    ///
     174    FDO_API virtual bool ReadNext() = 0;
     175};
     176}}}
     177
     178=== More points of discussion ===
     179
     180 * Support for certain index types?
     181 * Support in FdoIApplySchema and Fdo* schema classes instead?