[HACKERS] rte in set_plan_rel_pathlist()

2003-10-23 Thread phd9110



 
hi:in allpath.c ,the 
set_plan_rel_pathlist() function has a parameter of RangeTblEntry type.what 
does we use this varaible to do ?i doesn't see any code in this function 
using it .In optimizer module, it look like that we can get 
most information from Query . Is it right ?so , what time use Query? 
what time use RangeTblEntry? Are there any rule?Kao
136 /*137  * 
set_plain_rel_pathlist138  *        Build access 
paths for a plain relation (no subquery, no inheritance)139  */140 
static void141 set_plain_rel_pathlist(Query *root, RelOptInfo *rel, 
RangeTblEntry *rte)142 {143         /* Mark rel with 
estimated output rows, width, etc */144         
set_baserel_size_estimates(root, rel);145 146       
  /*147          * Generate paths and add them 
to the rel's pathlist.148          *149   
       * Note: add_path() will discard any paths that are 
dominated by another150          * available path, 
keeping only those paths that are superior along at151       
   * least one dimension of cost or sortedness.152     
     */153 154         /* Consider 
sequential scan */155         add_path(rel, 
create_seqscan_path(root, rel));156 157         /* 
Consider TID scans */158         
create_tidscan_paths(root, rel);159 160         /* 
Consider index paths for both simple and OR index clauses */161   
      create_index_paths(root, rel);162 163     
    /* create_index_paths must be done before create_or_index_paths 
*/164         create_or_index_paths(root, rel);165 
166         /* Now find the cheapest of the paths for 
this rel */167         set_cheapest(rel);168 
}169 --


[HACKERS] Where does catalog store CHAR length ?

2003-12-01 Thread phd9110



hi the table pg_attribute have the 
attribute  "attlen" , and this attribute willstore the attribute 
length. For example , when integer , this value will be 4.But if attribute 
type is Char(xx), this value will be -1. This is because itreference the 
bychar in pg_type table.So, where is the Char() length information store 
??and what time will system check this string length constraint 
?thanks for your help!Kao , Nchu 
Taiwan


[HACKERS] Does Catalog contain the information of index insert/update/delete tuples number ??

2003-12-04 Thread phd9110



hi :
pg_stat_user_tables store the  
n_tup_ins,n_tup_upd,n_tup_del information, and those information is very 
useful.
I check the pg_stat_user_indexes table, but there are no 
such information.
 
can i get such information in other way ?
or system catalog does not store such information 
!
or those information can be derived from other statistic 
?
 
i want use these information to tuning the index
please give me some suggestion!
 thank you very much!
 
Kao , Nchu Taiwan