~ubuntu-branches/ubuntu/trusty/postgresql-8.4/trusty

« back to all changes in this revision

Viewing changes to contrib/ltree/ltree_op.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * op function for ltree
3
3
 * Teodor Sigaev <teodor@stack.net>
4
 
 * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.19 2008/05/12 00:00:43 alvherre Exp $
 
4
 * $PostgreSQL: pgsql/contrib/ltree/ltree_op.c,v 1.20 2009/06/11 14:48:51 momjian Exp $
5
5
 */
6
6
#include "postgres.h"
7
7
 
58
58
Datum           ltreeparentsel(PG_FUNCTION_ARGS);
59
59
 
60
60
int
61
 
ltree_compare(const ltree * a, const ltree * b)
 
61
ltree_compare(const ltree *a, const ltree *b)
62
62
{
63
63
        ltree_level *al = LTREE_FIRST(a);
64
64
        ltree_level *bl = LTREE_FIRST(b);
152
152
}
153
153
 
154
154
bool
155
 
inner_isparent(const ltree * c, const ltree * p)
 
155
inner_isparent(const ltree *c, const ltree *p)
156
156
{
157
157
        ltree_level *cl = LTREE_FIRST(c);
158
158
        ltree_level *pl = LTREE_FIRST(p);
201
201
 
202
202
 
203
203
static ltree *
204
 
inner_subltree(ltree * t, int4 startpos, int4 endpos)
 
204
inner_subltree(ltree *t, int4 startpos, int4 endpos)
205
205
{
206
206
        char       *start = NULL,
207
207
                           *end = NULL;
283
283
}
284
284
 
285
285
static ltree *
286
 
ltree_concat(ltree * a, ltree * b)
 
286
ltree_concat(ltree *a, ltree *b)
287
287
{
288
288
        ltree      *r;
289
289
 
422
422
}
423
423
 
424
424
ltree *
425
 
lca_inner(ltree ** a, int len)
 
425
lca_inner(ltree **a, int len)
426
426
{
427
427
        int                     tmp,
428
428
                                num = ((*a)->numlevel) ? (*a)->numlevel - 1 : 0;
626
626
                else if (hist_size < 100)
627
627
                {
628
628
                        /*
629
 
                         * For histogram sizes from 10 to 100, we combine the
630
 
                         * histogram and default selectivities, putting increasingly
631
 
                         * more trust in the histogram for larger sizes.
 
629
                         * For histogram sizes from 10 to 100, we combine the histogram
 
630
                         * and default selectivities, putting increasingly more trust in
 
631
                         * the histogram for larger sizes.
632
632
                         */
633
 
                        double  hist_weight = hist_size / 100.0;
 
633
                        double          hist_weight = hist_size / 100.0;
634
634
 
635
635
                        selec = selec * hist_weight +
636
636
                                DEFAULT_PARENT_SEL * (1.0 - hist_weight);