summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam.c
Commit message (Collapse)AuthorAgeFilesLines
* The 1st step to implement new type of scan,TidScan.Hiroshi Inoue1999-10-111-1/+90
| | | | | Now WHERE restriction on ctid is allowed though it is sequentially scanned.
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-241-17/+19
| | | | | | | | | | | | | | | | | | | | | * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-181-21/+70
| | | | | | | | | | | | | | | | | 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.
* Install new alignment code to use MAXALIGN rather than DOUBLEALIGN whereBruce Momjian1999-07-191-2/+2
| | | | approproate.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-171-6/+1
|
* Final cleanup.Bruce Momjian1999-07-161-6/+7
|
* Change #include's to use <> and "" as appropriate.Bruce Momjian1999-07-151-12/+12
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-151-7/+1
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-151-2/+1
|
* Cleanup of /include #include's, for 6.6 only.Bruce Momjian1999-07-141-1/+3
|
* cleanupBruce Momjian1999-07-091-2/+1
|
* typo fix.Bruce Momjian1999-07-021-2/+2
|
* 1. Fix for elog(ERROR, "EvalPlanQual: t_xmin is uncommitted ?!")Vadim B. Mikheev1999-06-101-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and possibly for other cases too: DO NOT cache status of transaction in unknown state (i.e. non-committed and non-aborted ones) Example: T1 reads row updated/inserted by running T2 and cache T2 status. T2 commits. Now T1 reads a row updated by T2 and with HEAP_XMAX_COMMITTED in t_infomask (so cached T2 status is not changed). Now T1 EvalPlanQual gets updated row version without HEAP_XMIN_COMMITTED -> TransactionIdDidCommit(t_xmin) and TransactionIdDidAbort(t_xmin) return FALSE and T2 decides that t_xmin is not committed and gets ERROR above. It's too late to find more smart way to handle such cases and so I just changed xact status caching and got rid TransactionIdFlushCache() from code. Changed: transam.c, xact.c, lmgr.c and transam.h - last three just because of TransactionIdFlushCache() is removed. 2. heapam.c: T1 marked a row for update. T2 waits for T1 commit/abort. T1 commits. T3 updates the row before T2 locks row page. Now T2 sees that new row t_xmax is different from xact id (T1) T2 was waiting for. Old code did Assert here. New one goes to HeapTupleSatisfiesUpdate. Obvious changes too. 3. Added Assert to vacuum.c 4. bufmgr.c: break Assert(buf->r_locks == 0 && !buf->ri_lock) into two Asserts.
* pgindent run over code.Bruce Momjian1999-05-251-55/+57
|
* 1. Vacuum is updated for MVCC.Vadim B. Mikheev1999-03-281-2/+2
| | | | | | | 2. Much faster btree tuples deletion in the case when first on page index tuple is deleted (no movement to the left page(s)). 3. Remember blkno of new root page in BTPageOpaque of left/right siblings when root page is splitted.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-131-2/+2
|
* READ COMMITTED isolevel is implemented and is default now.Vadim B. Mikheev1999-01-291-1/+2
|
* Initial MVCC code.Vadim B. Mikheev1998-12-151-249/+247
| | | | New code for locking buffer' context.
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-271-206/+204
|
* Fix for vacuum and cache use. Fix for BSDI 4.0.Bruce Momjian1998-10-121-25/+1
|
* Make functions static or ifdef NOT_USED. Prevent pg_version creation.Bruce Momjian1998-10-081-2/+4
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-011-19/+22
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-011-23/+23
|
* fix for index problem.Bruce Momjian1998-08-201-19/+19
|
* heap_fetch requires buffer pointer, must be released; heap_getnextBruce Momjian1998-08-191-236/+240
| | | | | | | | | | | | | 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-271-14/+14
|
* Cleanup use of 16 that should be NAMEDATALEN.Bruce Momjian1998-07-201-4/+4
|
* Change error message and remove non-functional update message, fromBruce Momjian1998-06-161-2/+5
| | | | Vadim.
* Remove un-needed braces around single statements.Bruce Momjian1998-06-151-51/+1
|
* pgindent run before 6.3 release, with Thomas' requested changes.Bruce Momjian1998-02-261-9/+10
|
* Goodbye register keyword. Compiler knows better.Bruce Momjian1998-02-111-2/+2
|
* Goodbye ABORT. Hello ERROR for all errors.Bruce Momjian1998-01-071-14/+14
|
* Change elog(WARN) to elog(ERROR) and elog(ABORT).Bruce Momjian1998-01-051-14/+14
|
* Remove archive stuff.Bruce Momjian1997-11-211-2/+2
|
* Remove all time travel stuff. Small parser cleanup.Bruce Momjian1997-11-201-39/+22
|
* Good Bye, Time Travel!Vadim B. Mikheev1997-11-021-8/+7
|
* Inline frequently called functions.Bruce Momjian1997-09-181-15/+20
|
* Used modified version of indent that understands over 100 typedefs.Bruce Momjian1997-09-081-4/+4
|
* Add typdefs to pgindent run.Bruce Momjian1997-09-081-4/+4
|
* Another PGINDENT run that changes variable indenting and case label ↵Bruce Momjian1997-09-081-31/+31
| | | | indenting. Also static variable indenting.
* Massive commit to run PGINDENT on all *.c and *.h files.Bruce Momjian1997-09-071-1208/+1323
|
* heap_delete returns int now (for non-functional deletes).Vadim B. Mikheev1997-08-271-7/+9
|
* Make functions static where possible, enclose unused functions in #ifdef ↵Bruce Momjian1997-08-191-1/+3
| | | | NOT_USED.
* Remove more (void) and fix -Wall warnings.Bruce Momjian1997-08-121-2/+2
|
* Catch non-functional delete attempts.Vadim B. Mikheev1997-08-061-1/+14
|
* From: Dan McGuirk <mcguirk@indirect.com>Marc G. Fournier1997-03-281-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reply-To: hackers@hub.org, Dan McGuirk <mcguirk@indirect.com> To: hackers@hub.org Subject: [HACKERS] tmin writeback optimization I was doing some profiling of the backend, and noticed that during a certain benchmark I was running somewhere between 30% and 75% of the backend's CPU time was being spent in calls to TransactionIdDidCommit() from HeapTupleSatisfiesNow() or HeapTupleSatisfiesItself() to determine that changed rows' transactions had in fact been committed even though the rows' tmin values had not yet been set. When a query looks at a given row, it needs to figure out whether the transaction that changed the row has been committed and hence it should pay attention to the row, or whether on the other hand the transaction is still in progress or has been aborted and hence the row should be ignored. If a tmin value is set, it is known definitively that the row's transaction has been committed. However, if tmin is not set, the transaction referred to in xmin must be looked up in pg_log, and this is what the backend was spending a lot of time doing during my benchmark. So, implementing a method suggested by Vadim, I created the following patch that, the first time a query finds a committed row whose tmin value is not set, sets it, and marks the buffer where the row is stored as dirty. (It works for tmax, too.) This doesn't result in the boost in real time performance I was hoping for, however it does decrease backend CPU usage by up to two-thirds in certain situations, so it could be rather beneficial in high-concurrency settings.
* Removed unlinked patch that is not neede now that Vadim has properly fixed it.Bruce Momjian1997-01-231-9/+1
|
* Fix for SELECT INTO ... GROUP/ORDER BY where table already exists unlink error.Bruce Momjian1997-01-011-1/+9
|
* More cleanupsMarc G. Fournier1996-11-051-32/+16
|
* Changes required so that access/* compiles cleanly...Marc G. Fournier1996-11-031-38/+3
| | | | cleaning up behind myself before *yawn* bed :)