pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed[PERFORMANCE] Insights: fseek OR read_cluster?
6+ messages / 4 participants
[nested] [flat]
* [PERFORMANCE] Insights: fseek OR read_cluster?
@ 2011-09-23 20:03 Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Antonio Rodriges @ 2011-09-23 20:03 UTC (permalink / raw)
To: pgsql-performance
Hello,
It is interesting how PostgreSQL reads the tablefiie.
Whether its indexes store/use filesystem clusters locations containing
required data (so it can issue a low level cluster read) or it just
fseeks inside a file?
Thank you
^ permalink raw reply [nested|flat] 6+ messages in thread
* [PERFORMANCE] Insights: fseek OR read_cluster?
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
@ 2011-09-24 06:49 ` Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 07:59 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Craig Ringer <ringerc@ringerc.id.au>
0 siblings, 1 reply; 6+ messages in thread
From: Antonio Rodriges @ 2011-09-24 06:49 UTC (permalink / raw)
To: pgsql-performance
Hello,
It is interesting how PostgreSQL reads the tablefiie.
Whether its indexes store/use filesystem clusters locations containing
required data (so it can issue a low level cluster read) or it just
fseeks inside a file?
Thank you
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [PERFORMANCE] Insights: fseek OR read_cluster?
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
@ 2011-09-26 07:59 ` Craig Ringer <ringerc@ringerc.id.au>
2011-09-26 12:51 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Craig Ringer @ 2011-09-26 07:59 UTC (permalink / raw)
To: Antonio Rodriges <antonio.rrz@gmail.com>; +Cc: pgsql-performance
On 24/09/2011 2:49 PM, Antonio Rodriges wrote:
> Hello,
>
> It is interesting how PostgreSQL reads the tablefiie.
> Whether its indexes store/use filesystem clusters locations containing
> required data (so it can issue a low level cluster read) or it just
> fseeks inside a file?
What is read_cluster() ? Are you talking about some kind of async
and/or direct I/O? If so, PostgreSQL is not designed for direct I/O, it
benefits from using the OS's buffer cache, I/O scheduler, etc.
IIRC Pg uses pread() to read from its data files, but I didn't go double
check in the sources to make sure.
--
Craig Ringer
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [PERFORMANCE] Insights: fseek OR read_cluster?
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 07:59 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Craig Ringer <ringerc@ringerc.id.au>
@ 2011-09-26 12:51 ` Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 19:06 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Marti Raudsepp <marti@juffo.org>
0 siblings, 1 reply; 6+ messages in thread
From: Antonio Rodriges @ 2011-09-26 12:51 UTC (permalink / raw)
To: Craig Ringer <ringerc@ringerc.id.au>; pgsql-performance
Thank you, Craig, your answers are always insightful
> What is read_cluster() ? Are you talking about some kind of async and/or
I meant that if you want to read a chunk of data from file you (1)
might not call traditional fseek but rather memorize hard drive
cluster numbers to boost disk seeks and, (2) perform the read of disk
cluster directly.
> direct I/O? If so, PostgreSQL is not designed for direct I/O, it benefits
> from using the OS's buffer cache, I/O scheduler, etc.
>
> IIRC Pg uses pread() to read from its data files, but I didn't go double
> check in the sources to make sure.
>
> --
> Craig Ringer
>
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [PERFORMANCE] Insights: fseek OR read_cluster?
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 07:59 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Craig Ringer <ringerc@ringerc.id.au>
2011-09-26 12:51 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
@ 2011-09-26 19:06 ` Marti Raudsepp <marti@juffo.org>
2011-09-27 16:12 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Marti Raudsepp @ 2011-09-26 19:06 UTC (permalink / raw)
To: Antonio Rodriges <antonio.rrz@gmail.com>; +Cc: Craig Ringer <ringerc@ringerc.id.au>; pgsql-performance
On Mon, Sep 26, 2011 at 15:51, Antonio Rodriges <antonio.rrz@gmail.com> wrote:
>> What is read_cluster() ? Are you talking about some kind of async and/or
>
> I meant that if you want to read a chunk of data from file you (1)
> might not call traditional fseek but rather memorize hard drive
> cluster numbers to boost disk seeks and, (2) perform the read of disk
> cluster directly.
PostgreSQL accesses regular files on a file system via lseek(), read()
and write() calls, no magic.
In modern extent-based file systems, mapping a file offset to a
physical disk sector is very fast -- compared to the time of actually
accessing the disk.
I can't see how direct cluster access would even work, unless you'd
give the database direct access to a raw partition, in which case
Postgres would effectively have to implement its own file system. The
gains are simply not worth it for Postgres, our developer resources
are better spent elsewhere.
Regards,
Marti
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [PERFORMANCE] Insights: fseek OR read_cluster?
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 07:59 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Craig Ringer <ringerc@ringerc.id.au>
2011-09-26 12:51 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 19:06 ` Re: [PERFORMANCE] Insights: fseek OR read_cluster? Marti Raudsepp <marti@juffo.org>
@ 2011-09-27 16:12 ` Antonio Rodriges <antonio.rrz@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Antonio Rodriges @ 2011-09-27 16:12 UTC (permalink / raw)
To: Marti Raudsepp <marti@juffo.org>; pgsql-performance
Thank you, Marti,
Is there any comprehensive survey of (at least most, if not all)
modern features of operating systems, for example I/O scheduling,
extent-based filesytems, etc.?
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2011-09-27 16:12 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-23 20:03 [PERFORMANCE] Insights: fseek OR read_cluster? Antonio Rodriges <rodriges@csm.donntu.edu.ua>
2011-09-24 06:49 ` Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 07:59 ` Craig Ringer <ringerc@ringerc.id.au>
2011-09-26 12:51 ` Antonio Rodriges <antonio.rrz@gmail.com>
2011-09-26 19:06 ` Marti Raudsepp <marti@juffo.org>
2011-09-27 16:12 ` Antonio Rodriges <antonio.rrz@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox