summaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
Commit message (Collapse)AuthorAgeFilesLines
* Add recreate index notice to vacuum error.Bruce Momjian1999-11-141-3/+3
|
* New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian1999-11-071-16/+16
| | | | | | Fewer calls to nameout. Better use of RelationGetRelationName.
* Make tree compilable (+WAL).Vadim B. Mikheev1999-09-281-8/+6
|
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-241-7/+8
| | | | | | | | | | | | | | | | | | | | | * 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-23/+21
| | | | | | | | | | | | | | | | | 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.
* Fix vacuum's memory consumptionTatsuo Ishii1999-08-251-4/+11
|
* Store -1 in attdisbursion to signal 'no duplicates in column'.Tom Lane1999-08-091-26/+36
| | | | Centralize att_disbursion readout logic.
* For a unique-key attribute (no duplicate values), vacuum analyzeTom Lane1999-08-081-8/+16
| | | | was recording a disbursion of 0, not the correct value 1/numberOfRows.
* First step in fixing selectivity-estimation code. eqsel andTom Lane1999-08-011-22/+46
| | | | | | | | | | 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.
* Install new alignment code to use MAXALIGN rather than DOUBLEALIGN whereBruce Momjian1999-07-191-5/+5
| | | | approproate.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-171-2/+1
|
* Final cleanup.Bruce Momjian1999-07-161-2/+3
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-151-12/+1
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-151-2/+1
|
* Fix to prevent too large tuple from being created.Bruce Momjian1999-07-031-2/+2
|
* Change Assert(Ptp.t_data->t_xmax == tp.t_data->t_xmin) to :Vadim B. Mikheev1999-06-111-3/+30
| | | | | | | | | | | | | | | | | /* * Read above about cases when !ItemIdIsUsed(Citemid) * (child item is removed)... Due to the fact that * at the moment we don't remove unuseful part of * update-chain, it's possible to get too old * parent row here. Like as in the case which * caused this problem, we stop shrinking here. * I could try to find real parent row but want * not to do it because of real solution will * be implemented anyway, latter, and we are too * close to 6.5 release. - vadim 06/11/99 */ if (Ptp.t_data->t_xmax != tp.t_data->t_xmin) ...
* 1. Fix for elog(ERROR, "EvalPlanQual: t_xmin is uncommitted ?!")Vadim B. Mikheev1999-06-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 1. xact.c: update comments about changing MyProc->xid and MyProc->xmin.Vadim B. Mikheev1999-06-061-3/+22
| | | | | | | | | | | 2. varsup.c:ReadNewTransactionId(): don't read nextXid from disk - this func doesn't allocate next xid, so ShmemVariableCache->nextXid may be used (but GetNewTransactionId() must be called first). 3. vacuum.c: change elog(ERROR, "Child item....") to elog(NOTICE) - this is not ERROR, proper handling is just not implemented, yet. 4. s_lock.c: increase S_MAX_BUSY by 2 times. 5. shmem.c:GetSnapshotData(): have to call ReadNewTransactionId() _after_ SpinAcquire(ShmemIndexLock).
* Unuseful tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED inVadim B. Mikheev1999-06-031-3/+2
| | | | vc_scanheap().
* 1. Run all pg_dump queries in single serializable transaction.Vadim B. Mikheev1999-05-291-19/+5
| | | | | | 2. Get rid of locking when updating statistics in vacuum. 3. Use QuerySnapshot in COPY TO and call SetQuerySnashot in main tcop loop before FETCH and COPY TO.
* pgindent run over code.Bruce Momjian1999-05-251-191/+207
|
* Fix tuple chain moving bug found by "Hiroshi Inoue" <Inoue@tpf.co.jp>.Vadim B. Mikheev1999-05-231-17/+105
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-101-2/+2
| | | | real affect now.
* Mistyping by me.Vadim B. Mikheev1999-05-091-3/+3
| | | | Fixed by Hiroshi.
* Arrange for VACUUM to delete the init file that relcache.c usesTom Lane1999-05-011-2/+16
| | | | | | to save a little bit of backend startup time. This way, the first backend started after a VACUUM will rebuild the init file with up-to-date statistics for the critical system indexes.
* Some comments...Vadim B. Mikheev1999-04-121-2/+7
|
* Clean up compile errors and warnings, cf Billy Allie'sTom Lane1999-04-021-7/+6
| | | | complaints (and some of my own).
* 1. Vacuum is updated for MVCC.Vadim B. Mikheev1999-03-281-60/+487
| | | | | | | 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.
* From: Tatsuo Ishii <t-ishii@sra.co.jp>Marc G. Fournier1999-02-211-2/+2
| | | | | | Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef NOT_USED" for current. I have tested these patches in that the postgres binaries are identical.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-131-2/+2
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-031-3/+2
|
* Apply Win32 patch from Horak Daniel.Bruce Momjian1999-01-171-1/+5
|
* Initial MVCC code.Vadim B. Mikheev1998-12-151-8/+4
| | | | New code for locking buffer' context.
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-271-99/+75
|
* Fix from Jan for vacuum statistics loss.Bruce Momjian1998-10-231-4/+24
|
* Update for bsdi 3.0.Bruce Momjian1998-10-231-5/+4
|
* Fix for vacuum and cache use. Fix for BSDI 4.0.Bruce Momjian1998-10-121-7/+4
|
* Reverse out vacuum change.Bruce Momjian1998-10-091-32/+1
|
* major/minor shared name cleanupBruce Momjian1998-10-091-1/+32
|
* Hello!Bruce Momjian1998-10-081-2/+1
| | | | | | | | | | | | | | | | | | | Here are two new patches for the Win32 support. 1) The patch based on the one from Hiroshi Inoue [Inoue@tpf.co.jp], to load Winsock.dll from libpq.dll. 2) A patch for psql.c to remove the call to WSAStartup(), since it is not required when it's done in libpq.dll. I'm still looking for the possibility of having a crypt() function in libpq.dll too, the same way getopt was included. Any chance of getting this before 6.4, or should we wait for the next one? //Magnus
* vacuum cleanupsBruce Momjian1998-10-071-29/+9
|
* Fix snprintf.c for machines that don't have long long, like some Irix.Bruce Momjian1998-10-071-3/+3
|
* Allow 8-key indexes.Bruce Momjian1998-09-231-2/+2
|
* Fix for indexing problems.Bruce Momjian1998-09-021-2/+2
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-011-36/+45
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-011-38/+38
|
* vacuum fix.Bruce Momjian1998-08-281-13/+7
|
* Hi all,Bruce Momjian1998-08-281-6/+4
| | | | | | | | | | | | | | | | | | | | | | | I don't know if this is really related to the initdb problem discussion (haven't followed it enough). But seems so because it fixes a damn problem during index tuple insertion on CREATE TABLE into pg_attribute_relid_attnum_index. Anyway - this bug was really hard to find. During startup the relcache reads in some prepared information about index strategies from a file and then reinitializes the function pointers inside the scanKey data. But for sake it assumed single attribute index tuples (hasn't that changed recently). Thus not all the strategies scanKey entries where initialized properly, resulting in invalid addresses for the btree comparision functions. With the patch at the end the regression tests passed excellent except for the sanity_check that crashed at vacuum and the misc test where the select unique1 from onek2 outputs the two rows in different order. Jan
* fix for index problem.Bruce Momjian1998-08-201-2/+2
|
* Another vacuum fix.Bruce Momjian1998-08-201-8/+9
|