aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
Commit message (Collapse)AuthorAge
...
* Third round of fmgr updates: eliminate calls using fmgr() andTom Lane2000-05-30
| | | | | fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
* First round of changes for new fmgr interface. fmgr itself and theTom Lane2000-05-28
| | | | | | | key call sites are changed, but most called functions are still oldstyle. An exception is that the PL managers are updated (so, for example, NULL handling now behaves as expected in plperl and plpgsql functions). NOTE initdb is forced due to added column in pg_proc.
* Reduce eqsel()'s fudge-factor for estimating the frequency of valuesTom Lane2000-05-26
| | | | | | | other than the most common value in a column. We had had 0.5, make it 0.1 to make it more likely that an indexscan will be chosen. Really need better statistics instead, but this should stem the bleeding meanwhile ...
* Add new selectivity estimation functions for pattern-matching operatorsTom Lane2000-04-16
| | | | | | | | (LIKE and regexp matches). These are not yet referenced in pg_operator, so by default the system will continue to use eqsel/neqsel. Also, tweak convert_to_scalar() logic so that common prefixes of strings are stripped off, allowing better accuracy when all strings in a table share a common prefix.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Further tweaking of indexscan cost estimates.Tom Lane2000-04-09
|
* Tweak indexscan cost estimation: round estimated # of tuples visited upTom Lane2000-03-30
| | | | | | | to next integer. Previously, if selectivity was small, we could compute very tiny scan cost on the basis of estimating that only 0.001 tuple would be fetched, which is silly. This naturally led to some rather silly plans...
* Improve selectivity estimation involving string constants: pay attentionTom Lane2000-03-23
| | | | | to more than one character, and try to do the right thing in non-ASCII locales.
* Reverse out BYTEA type coersion.Bruce Momjian2000-03-20
|
* Update for BYTEAOID.Bruce Momjian2000-03-20
|
* Add compatiblity information for bytea.Bruce Momjian2000-03-20
|
* Add date and time datatype handling to convert_to_scalar. (I was waitingTom Lane2000-02-26
| | | | | for Thomas to do the datetime consolidation before touching this, but it's done now...)
* Make eqsel produce better results for boolean columns,Tom Lane2000-02-16
| | | | | and make scalarltsel a little more forgiving at the boundaries of the known range of a column value.
* New cost model for planning, incorporating a penalty for random pageTom Lane2000-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | accesses versus sequential accesses, a (very crude) estimate of the effects of caching on random page accesses, and cost to evaluate WHERE- clause expressions. Export critical parameters for this model as SET variables. Also, create SET variables for the planner's enable flags (enable_seqscan, enable_indexscan, etc) so that these can be controlled more conveniently than via PGOPTIONS. Planner now estimates both startup cost (cost before retrieving first tuple) and total cost of each path, so it can optimize queries with LIMIT on a reasonable basis by interpolating between these costs. Same facility is a win for EXISTS(...) subqueries and some other cases. Redesign pathkey representation to achieve a major speedup in planning (I saw as much as 5X on a 10-way join); also minor changes in planner to reduce memory consumption by recycling discarded Path nodes and not constructing unnecessary lists. Minor cleanups to display more-plausible costs in some cases in EXPLAIN output. Initdb forced by change in interface to index cost estimation functions.
* Add:Bruce Momjian2000-01-26
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* First cut at making useful selectivity estimates for range queriesTom Lane2000-01-24
| | | | | | | | | | | | (ie, WHERE x > lowbound AND x < highbound). It's not very bright yet but it does something useful. Also, rename intltsel/intgtsel to scalarltsel/scalargtsel to reflect usage better. Extend convert_to_scalar to do something a little bit useful with string data types. Still need to make it do something with date/time datatypes, but I'll wait for Thomas's datetime unification dust to settle first. Eventually the routine ought not have any type-specific knowledge at all; it ought to be calling a type-dependent routine found via a pg_type column; but that's a task for another day.
* Remove Ops parameter from STATRELID cache lookup, for Tom Lane andBruce Momjian2000-01-24
| | | | optimizer.
* Replace SearchSysCacheGetAttribute with SysCacheGetAttr, which fetchesTom Lane2000-01-23
| | | | | | an attribute of a tuple previously fetched with SearchSysCacheTuple. This avoids a lot of redundant cache lookups, particularly in selfuncs.c. Also, remove SearchSysCacheStruct, which was unused and grotty.
* First cut at unifying regular selectivity estimation with indexscanTom Lane2000-01-23
| | | | selectivity estimation wasn't right. This is better...
* Revise handling of index-type-specific indexscan cost estimation, perTom Lane2000-01-22
| | | | | | pghackers discussion of 5-Jan-2000. The amopselect and amopnpages estimators are gone, and in their place is a per-AM amcostestimate procedure (linked to from pg_am, not pg_amop).
* Fix a passel of problems with incorrect calls to typinput and typoutputTom Lane2000-01-15
| | | | | | | functions, which would lead to trouble with datatypes that paid attention to the typelem or typmod parameters to these functions. In particular, incorrect code in pg_aggregate.c explains the platform-specific failures that have been reported in NUMERIC avg().
* Fixed all elog related warnings, as well as a few others.Peter Eisentraut2000-01-15
|
* Make number of args to a function configurable.Bruce Momjian2000-01-10
|
* Another round of planner/optimizer work. This is just restructuring andTom Lane2000-01-09
| | | | | code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
* Add opid to selectivity function call.Bruce Momjian1999-11-25
|
* Enable pg_statistic cache use.Bruce Momjian1999-11-25
|
* Add system indexes to match all caches.Bruce Momjian1999-11-22
| | | | | | | Make all system indexes unique. Make all cache loads use system indexes. Rename *rel to *relid in inheritance tables. Rename cache names to be clearer.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Repair error noticed by Roberto Cornacchia: selectivity codeTom Lane1999-09-09
| | | | | | | | was rejecting negative attnums as bogus, which of course they are not. Add code to get_attdisbursion to produce a useful value for OID attribute, since VACUUM does not store stats for system attributes. Also, repair bug that's been in eqjoinsel for a long time: it was taking the max of the two columns' disbursions, whereas it should use the min.
* Ooops ... I had left some test coding in selfuncs.c thatTom Lane1999-08-21
| | | | failed on 'field < textconstant' ...
* Store -1 in attdisbursion to signal 'no duplicates in column'.Tom Lane1999-08-09
| | | | Centralize att_disbursion readout logic.
* Further selectivity-estimation work. Speed up eqsel()Tom Lane1999-08-02
| | | | | | | | | (it should just call the given operator, not look up an = operator). Fix intltsel() so that all numeric data types are converted to double before trying to estimate where the given comparison value is in the known range of column values. intltsel() still needs work, or replacement, for non-numeric data types ... but for nonintegral numeric types it should now be delivering reasonable estimates.
* First step in fixing selectivity-estimation code. eqsel andTom Lane1999-08-01
| | | | | | | | | | neqsel now behave as per my suggestions in pghackers a few days ago. selectivity for < > <= >= should work OK for integral types as well, but still need work for nonintegral types. Since these routines have never actually executed before :-(, this may result in some significant changes in the optimizer's choices of execution plans. Let me know if you see any serious misbehavior. CAUTION: THESE CHANGES REQUIRE INITDB. pg_statistic table has changed.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Final cleanup.Bruce Momjian1999-07-16
|
* Update #include cleanupsBruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* Temporarily disable error checks for missing selectivityTom Lane1999-06-19
| | | | | functions, in order to work around oversight in 6.5 release: rtree index functions haven't got any. Mea culpa ...
* Generate a more specific error message when an operator usedTom Lane1999-05-31
| | | | in an index doesn't have a restriction selectivity estimator.
* pgindent run over code.Bruce Momjian1999-05-25
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* cleanupsBruce Momjian1999-03-18
|
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Fix for returning stack pointer from selectivity, from Bernard Frankpitt.Bruce Momjian1999-02-05
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-01
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-01
|
* heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian1998-08-19
| | | | | | | | | | | | | no longer returns buffer pointer, can be gotten from scan; descriptor; bootstrap can create multi-key indexes; pg_procname index now is multi-key index; oidint2, oidint4, oidname are gone (must be removed from regression tests); use System Cache rather than sequential scan in many places; heap_modifytuple no longer takes buffer parameter; remove unused buffer parameter in a few other functions; oid8 is not index-able; remove some use of single-character variable names; cleanup Buffer variables usage and scan descriptor looping; cleaned up allocation and freeing of tuples; 18k lines of diff;
* Use Snapshot in heap access methods.Vadim B. Mikheev1998-07-27
|
* Remove un-needed braces around single statements.Bruce Momjian1998-06-15
|