On Fri, 3 May 2024 at 09:33, David Zhang wrote:
> Is there a simple way to get the min of ctid faster than using min(), but
> similar to get the max of ctid using pg_relation_size?
The equivalent approximation is always '(0,1)'.
David
Thanks a lot David Rowley for your suggestion in details.
On 2024-04-08 3:23 p.m., David Rowley wrote:
On Tue, 9 Apr 2024 at 09:52, David Zhang wrote:
Finding the exact ctid seems overkill for what you need. Why you
could just find the maximum block with:
N = pg_relation_size('name_of_your_ta
On Tue, 9 Apr 2024 at 11:02, Tom Lane wrote:
>
> David Rowley writes:
> > Unsure if such a feature is worthwhile. I think maybe not for just
> > min(ctid)/max(ctid). However, there could be other reasons, such as
> > the transform OR to UNION stuff that Tom worked on a few years ago.
> > That nee
David Rowley writes:
> Unsure if such a feature is worthwhile. I think maybe not for just
> min(ctid)/max(ctid). However, there could be other reasons, such as
> the transform OR to UNION stuff that Tom worked on a few years ago.
> That needed to eliminate duplicate rows that matched both OR branc
On Tue, 9 Apr 2024 at 09:52, David Zhang wrote:
> However, when executing SELECT min(ctid) and max(ctid), it performs a
> Seq Scan, which can be slow for a large table. Is there a way to
> retrieve the minimum and maximum ctid other than using the system
> functions min() and max()?
Finding the e