mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 00:01:55 -04:00
Compare commits
No commits in common. "3c9d9acae0bc0cd2f905043cb1d581baec4622c4" and "b485ad7f07c80efbfd47329f138f0fe3a5acf013" have entirely different histories.
3c9d9acae0
...
b485ad7f07
@ -18461,7 +18461,7 @@ insertSelectOptions(SelectStmt *stmt,
|
|||||||
parser_errposition(exprLocation(limitClause->limitCount))));
|
parser_errposition(exprLocation(limitClause->limitCount))));
|
||||||
stmt->limitCount = limitClause->limitCount;
|
stmt->limitCount = limitClause->limitCount;
|
||||||
}
|
}
|
||||||
if (limitClause)
|
if (limitClause && limitClause->limitOption != LIMIT_OPTION_DEFAULT)
|
||||||
{
|
{
|
||||||
if (stmt->limitOption)
|
if (stmt->limitOption)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -1143,7 +1143,7 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
|
|||||||
MemSet((char *) bufBlock, 0, BLCKSZ);
|
MemSet((char *) bufBlock, 0, BLCKSZ);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
instr_time io_start = pgstat_prepare_io_time(track_io_timing);
|
instr_time io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
smgrread(smgr, forkNum, blockNum, bufBlock);
|
smgrread(smgr, forkNum, blockNum, bufBlock);
|
||||||
|
|
||||||
@ -2070,7 +2070,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: if smgrzeroextend fails, we will end up with buffers that are
|
* Note: if smgrzeroextend fails, we will end up with buffers that are
|
||||||
@ -3523,7 +3523,7 @@ FlushBuffer(BufferDesc *buf, SMgrRelation reln, IOObject io_object,
|
|||||||
*/
|
*/
|
||||||
bufToWrite = PageSetChecksumCopy((Page) bufBlock, buf->tag.blockNum);
|
bufToWrite = PageSetChecksumCopy((Page) bufBlock, buf->tag.blockNum);
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* bufToWrite is either the shared buffer or a copy, as appropriate.
|
* bufToWrite is either the shared buffer or a copy, as appropriate.
|
||||||
@ -4181,7 +4181,7 @@ FlushRelationBuffers(Relation rel)
|
|||||||
|
|
||||||
PageSetChecksumInplace(localpage, bufHdr->tag.blockNum);
|
PageSetChecksumInplace(localpage, bufHdr->tag.blockNum);
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
smgrwrite(RelationGetSmgr(rel),
|
smgrwrite(RelationGetSmgr(rel),
|
||||||
BufTagGetForkNum(&bufHdr->tag),
|
BufTagGetForkNum(&bufHdr->tag),
|
||||||
@ -5614,7 +5614,7 @@ IssuePendingWritebacks(WritebackContext *wb_context, IOContext io_context)
|
|||||||
sort_pending_writebacks(wb_context->pending_writebacks,
|
sort_pending_writebacks(wb_context->pending_writebacks,
|
||||||
wb_context->nr_pending);
|
wb_context->nr_pending);
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Coalesce neighbouring writes, but nothing else. For that we iterate
|
* Coalesce neighbouring writes, but nothing else. For that we iterate
|
||||||
|
@ -246,7 +246,7 @@ GetLocalVictimBuffer(void)
|
|||||||
|
|
||||||
PageSetChecksumInplace(localpage, bufHdr->tag.blockNum);
|
PageSetChecksumInplace(localpage, bufHdr->tag.blockNum);
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/* And write... */
|
/* And write... */
|
||||||
smgrwrite(oreln,
|
smgrwrite(oreln,
|
||||||
@ -411,7 +411,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/* actually extend relation */
|
/* actually extend relation */
|
||||||
smgrzeroextend(bmr.smgr, fork, first_block, extend_by, false);
|
smgrzeroextend(bmr.smgr, fork, first_block, extend_by, false);
|
||||||
|
@ -1189,7 +1189,7 @@ register_dirty_segment(SMgrRelation reln, ForkNumber forknum, MdfdVec *seg)
|
|||||||
ereport(DEBUG1,
|
ereport(DEBUG1,
|
||||||
(errmsg_internal("could not forward fsync request because request queue is full")));
|
(errmsg_internal("could not forward fsync request because request queue is full")));
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
if (FileSync(seg->mdfd_vfd, WAIT_EVENT_DATA_FILE_SYNC) < 0)
|
if (FileSync(seg->mdfd_vfd, WAIT_EVENT_DATA_FILE_SYNC) < 0)
|
||||||
ereport(data_sync_elevel(ERROR),
|
ereport(data_sync_elevel(ERROR),
|
||||||
@ -1586,7 +1586,7 @@ mdsyncfiletag(const FileTag *ftag, char *path)
|
|||||||
need_to_close = true;
|
need_to_close = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
io_start = pgstat_prepare_io_time(track_io_timing);
|
io_start = pgstat_prepare_io_time();
|
||||||
|
|
||||||
/* Sync the file. */
|
/* Sync the file. */
|
||||||
result = FileSync(file, WAIT_EVENT_DATA_FILE_SYNC);
|
result = FileSync(file, WAIT_EVENT_DATA_FILE_SYNC);
|
||||||
|
@ -92,25 +92,15 @@ pgstat_count_io_op_n(IOObject io_object, IOContext io_context, IOOp io_op, uint3
|
|||||||
have_iostats = true;
|
have_iostats = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Initialize the internal timing for an IO operation, depending on an
|
|
||||||
* IO timing GUC.
|
|
||||||
*/
|
|
||||||
instr_time
|
instr_time
|
||||||
pgstat_prepare_io_time(bool track_io_guc)
|
pgstat_prepare_io_time(void)
|
||||||
{
|
{
|
||||||
instr_time io_start;
|
instr_time io_start;
|
||||||
|
|
||||||
if (track_io_guc)
|
if (track_io_timing)
|
||||||
INSTR_TIME_SET_CURRENT(io_start);
|
INSTR_TIME_SET_CURRENT(io_start);
|
||||||
else
|
else
|
||||||
{
|
|
||||||
/*
|
|
||||||
* There is no need to set io_start when an IO timing GUC is disabled,
|
|
||||||
* still initialize it to zero to avoid compiler warnings.
|
|
||||||
*/
|
|
||||||
INSTR_TIME_SET_ZERO(io_start);
|
INSTR_TIME_SET_ZERO(io_start);
|
||||||
}
|
|
||||||
|
|
||||||
return io_start;
|
return io_start;
|
||||||
}
|
}
|
||||||
|
@ -440,6 +440,7 @@ typedef enum LimitOption
|
|||||||
{
|
{
|
||||||
LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */
|
LIMIT_OPTION_COUNT, /* FETCH FIRST... ONLY */
|
||||||
LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */
|
LIMIT_OPTION_WITH_TIES, /* FETCH FIRST... WITH TIES */
|
||||||
|
LIMIT_OPTION_DEFAULT, /* No limit present */
|
||||||
} LimitOption;
|
} LimitOption;
|
||||||
|
|
||||||
#endif /* NODES_H */
|
#endif /* NODES_H */
|
||||||
|
@ -519,7 +519,7 @@ extern bool pgstat_bktype_io_stats_valid(PgStat_BktypeIO *backend_io,
|
|||||||
BackendType bktype);
|
BackendType bktype);
|
||||||
extern void pgstat_count_io_op(IOObject io_object, IOContext io_context, IOOp io_op);
|
extern void pgstat_count_io_op(IOObject io_object, IOContext io_context, IOOp io_op);
|
||||||
extern void pgstat_count_io_op_n(IOObject io_object, IOContext io_context, IOOp io_op, uint32 cnt);
|
extern void pgstat_count_io_op_n(IOObject io_object, IOContext io_context, IOOp io_op, uint32 cnt);
|
||||||
extern instr_time pgstat_prepare_io_time(bool track_io_guc);
|
extern instr_time pgstat_prepare_io_time(void);
|
||||||
extern void pgstat_count_io_op_time(IOObject io_object, IOContext io_context,
|
extern void pgstat_count_io_op_time(IOObject io_object, IOContext io_context,
|
||||||
IOOp io_op, instr_time start_time, uint32 cnt);
|
IOOp io_op, instr_time start_time, uint32 cnt);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user