1996-07-09 02:22:35 -04:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
*
|
1999-02-13 18:22:53 -05:00
|
|
|
* indexnode.c
|
1997-09-07 01:04:48 -04:00
|
|
|
* Routines to find all indices on a relation
|
1996-07-09 02:22:35 -04:00
|
|
|
*
|
2000-01-26 00:58:53 -05:00
|
|
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
|
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
1996-07-09 02:22:35 -04:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* IDENTIFICATION
|
2000-01-26 00:58:53 -05:00
|
|
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/Attic/indexnode.c,v 1.22 2000/01/26 05:56:40 momjian Exp $
|
1996-07-09 02:22:35 -04:00
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
#include "postgres.h"
|
|
|
|
|
|
1999-07-15 23:14:30 -04:00
|
|
|
#include "optimizer/pathnode.h"
|
1999-07-16 01:00:38 -04:00
|
|
|
#include "optimizer/plancat.h"
|
1996-07-09 02:22:35 -04:00
|
|
|
|
|
|
|
|
|
1997-09-07 01:04:48 -04:00
|
|
|
/*
|
1999-02-13 18:22:53 -05:00
|
|
|
* find_relation_indices
|
1997-09-07 01:04:48 -04:00
|
|
|
* Returns a list of index nodes containing appropriate information for
|
|
|
|
|
* each (secondary) index defined on a relation.
|
|
|
|
|
*
|
1996-07-09 02:22:35 -04:00
|
|
|
*/
|
1998-02-25 23:46:47 -05:00
|
|
|
List *
|
1999-05-25 18:43:53 -04:00
|
|
|
find_relation_indices(Query *root, RelOptInfo *rel)
|
1996-07-09 02:22:35 -04:00
|
|
|
{
|
1997-09-07 01:04:48 -04:00
|
|
|
if (rel->indexed)
|
1999-11-21 18:25:47 -05:00
|
|
|
return find_secondary_indexes(root, lfirsti(rel->relids));
|
1997-09-07 01:04:48 -04:00
|
|
|
else
|
1998-08-31 23:29:17 -04:00
|
|
|
return NIL;
|
1996-07-09 02:22:35 -04:00
|
|
|
}
|