Thread: how to calculate or know seq_scan scan how many blocks every time

how to calculate or know seq_scan scan how many blocks every time

From
leo xu
Date:
hello:
   i know oracle scatter read blocks,can set db_file_multiblock_read_count
every time,
   i see postgres,it exists scatter read blocks,it is seq_scan,how to know
scan many bloks every time?



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/how-to-calculate-or-know-seq-scan-scan-how-many-blocks-every-time-tp5717892.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

hello  everyone
    who can explain it ?thanks!



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/how-to-calculate-or-know-seq-scan-scan-how-many-blocks-every-time-tp5717892p5718082.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Re: how to calculate or know seq_scan scan how many blocks every time

From
Craig Ringer
Date:
On 07/25/2012 07:38 PM, leo xu wrote:
> hello:
>     i know oracle scatter read blocks,can set db_file_multiblock_read_count
> every time,
>     i see postgres,it exists scatter read blocks,it is seq_scan,how to know
> scan many bloks every time?
>

If I understand correctly, you want to have a sequential scan read from
more than one place at once.

This is not currently supported.

The effective_io_concurrency setting would be where you would set it,
but it does not affect sequential scans at the moment.

--
Craig Ringer

Hello Craig:
   I want to know a sequential scan( full scan table) it can read how many
blocks every io?
  I know scan index read is one block every io.

  Oracle parameter db_file_multiblock_read_count it can control scattered
read (full scan table),
  assume db_file_multiblock_read_count =10,when scan full table,every io
request blocks is 10 blocks.
  I know scan index read is one block every io.

  So I want to when  happen scan full table,postgresql scan full table scan
how many blocks every io?

 Thank you!
-----邮件原件-----
发件人: Craig Ringer [mailto:ringerc@ringerc.id.au]
发送时间: 2012年7月27日 8:41
收件人: leo xu
抄送: pgsql-general@postgresql.org
主题: Re: [GENERAL] how to calculate or know seq_scan scan how many blocks
every time

On 07/25/2012 07:38 PM, leo xu wrote:
> hello:
>     i know oracle scatter read blocks,can set
> db_file_multiblock_read_count every time,
>     i see postgres,it exists scatter read blocks,it is seq_scan,how to
> know scan many bloks every time?
>

If I understand correctly, you want to have a sequential scan read from more
than one place at once.

This is not currently supported.

The effective_io_concurrency setting would be where you would set it, but it
does not affect sequential scans at the moment.

--
Craig Ringer


On 07/27/2012 10:04 AM, leoxu wrote:
> Hello Craig:
>     I want to know a sequential scan( full scan table) it can read how many
> blocks every io?
>    I know scan index read is one block every io.
>
>    Oracle parameter db_file_multiblock_read_count it can control scattered
> read (full scan table),
>    assume db_file_multiblock_read_count =10,when scan full table,every io
> request blocks is 10 blocks.
>    I know scan index read is one block every io.
>
>    So I want to when  happen scan full table,postgresql scan full table scan
> how many blocks every io?

PostgreSQL uses the normal operating system facilities for file storage
and access to do its I/O, rather than doing direct unbuffered I/O to
files or even raw volumes like Oracle. It works quite differently, using
regular buffered I/O.

The amount of I/O required for and the I/O patterns of a sequential scan
in PostgreSQL depend on:

- The operating system readahead setting
- Whether the operating system has any of the desired blocks cached
- The file system and I/O scheduler in use

Because of that I'm not really sure your question can be answered,
except by benchmarking and real world measurement. PostgreSQL doesn't
really have the same concept of "an I/O" - though I guess a pread() call
would be fairly close.

What is your goal? What are you trying to achieve? Why are you trying to
determine this? What is the problem you are trying to solve?

--
Craig Ringer

Hello Craig:
   Thank you very much!

-----邮件原件-----
发件人: Craig Ringer [mailto:ringerc@ringerc.id.au]
发送时间: 2012年7月27日 11:00
收件人: leoxu
抄送: pgsql-general@postgresql.org
主题: Re: 答复: [GENERAL] how to calculate or know seq_scan scan how many
blocks every time

On 07/27/2012 10:04 AM, leoxu wrote:
> Hello Craig:
>     I want to know a sequential scan( full scan table) it can read how
> many blocks every io?
>    I know scan index read is one block every io.
>
>    Oracle parameter db_file_multiblock_read_count it can control
> scattered read (full scan table),
>    assume db_file_multiblock_read_count =10,when scan full table,every
> io request blocks is 10 blocks.
>    I know scan index read is one block every io.
>
>    So I want to when  happen scan full table,postgresql scan full
> table scan how many blocks every io?

PostgreSQL uses the normal operating system facilities for file storage and
access to do its I/O, rather than doing direct unbuffered I/O to files or
even raw volumes like Oracle. It works quite differently, using regular
buffered I/O.

The amount of I/O required for and the I/O patterns of a sequential scan in
PostgreSQL depend on:

- The operating system readahead setting
- Whether the operating system has any of the desired blocks cached
- The file system and I/O scheduler in use

Because of that I'm not really sure your question can be answered, except by
benchmarking and real world measurement. PostgreSQL doesn't really have the
same concept of "an I/O" - though I guess a pread() call would be fairly
close.

What is your goal? What are you trying to achieve? Why are you trying to
determine this? What is the problem you are trying to solve?

--
Craig Ringer