We do have a simple boolean right now: Column.isIndexed(). So if you're
just trying to find out what indexes are there, we have it covered.

But there have also been some requests to improve this information,  see
https://issues.apache.org/jira/browse/METAMODEL-16

2017-08-02 6:58 GMT-07:00 Dennis Du Krøger <
dennis.dukro...@humaninference.com>:

> I think it would make sense. At least in theory, we should be able to get
> that information from the JDBC metadata classes. However, not all drivers
> are equally nice at actually providing the data.
>
>
> Thinking of it, let's maybe wait with conclusions until Kasper (project
> lead) gets a chance to reply. He might know a way to extract that
> information with what we already have.
>
>
> Best regards,
>
> Dennis
>
> ________________________________
> From: Ashuthosh Bhat <techie.ab...@googlemail.com>
> Sent: 02 August 2017 15:48:57
> To: dev@metamodel.apache.org
> Subject: Re: Reading Indexes created in a DB
>
> Thanks for quick revert Dennis.
>
> Can code contribution towards retrieval/creation of indexes be considered?
>
> Thanks,
> Ashu
>
> On Wed, Aug 2, 2017 at 12:57 PM, Dennis Du Krøger <
> dennis.dukro...@humaninference.com> wrote:
>
> > Hi Ashu,
> >
> > Most information from SQL databases can be gathered using the
> > INFORMATION_SCHEMA schema. Unfortunately, indexes isn't one of them, so
> > you'll need to see if there are some something specific for each
> database.
> >
> > E.g. for SQL Server you can query sys.indexes to get a list of all
> > indexes. To get the tables the indexes belongs to, you need to join
> > sys.tables on the object ID
> >
> > I believe something similar is available for most databases. But it's of
> > course quite a bit more involved than just getting a list of indexes.
> >
> > Best regards,
> > Dennis
> >
> > ________________________________
> > From: Ashuthosh Bhat <techie.ab...@googlemail.com>
> > Sent: 02 August 2017 08:40:12
> > To: dev@metamodel.apache.org
> > Subject: Reading Indexes created in a DB
> >
> > Dear all,
> >
> > I am trying to read indexes created on various tables in a DB.  Is this
> > feature available in metamodel.  I could not find the same.
> >
> > Checked tabletypes as well there is no type as index.
> >
> > Please suggest.
> >
> > Thanks,
> > Ashu
> >
>

Reply via email to