Re: How to find greatest record before known values fast - Mailing list pgsql-general

From Andrus
Subject Re: How to find greatest record before known values fast
Date
Msg-id 0C4A85E2139C4680860B00CB25C598E9@dell2
Whole thread Raw
In response to Re: How to find greatest record before known values fast  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hi!

Thank you.

People often looks for different period sales using different filters.
There are lot of sales and every sale is individual record in sales table.
So increasing sequential scan speed is important.

I tried

create table t1(v char(100), p numeric(12,5));
create table t2(v varchar(100), p numeric(12,5));
insert into t1 select '', generate_series from generate_series(1,1000000);
insert into t2 select '', generate_series from generate_series(1,1000000);

and after that measured speed of

select sum(p) from t1

and

select sum(p) from t2

both of them took approximately 800 ms

So it looks like thee is no difference in sequential scan speed and thus no
need to change char types.

Andrus



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: How to callproc a PL/pgSQL function a cursor OUT parameter and two OUT parameters
Next
From: "Andrus"
Date:
Subject: Re: How to find greatest record before known values fast