pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
sequential scans on few columns tables
4+ messages / 3 participants
[nested] [flat]

* sequential scans on few columns tables
@ 2003-06-16 19:49 Tomasz Myrta <jasiek@klaster.net>
  2003-06-16 19:55 ` Re: sequential scans on few columns tables Bruno Wolff III <bruno@wolff.to>
  2003-06-16 22:45 ` Re: sequential scans on few columns tables Jim C. Nasby <jim@nasby.net>
  0 siblings, 2 replies; 4+ messages in thread

From: Tomasz Myrta @ 2003-06-16 19:49 UTC (permalink / raw)
  To: pgsql-performance

Hi
Recently I was wondering about tables difficult to index. Example - 
queries with "ilike" where clauses. Without additional contrib modules 
the only way to search such tables is sequential scan (am I right?)

The point is too keep these tables as small as possible. We can do this 
by denormalizing tables. Let's say we have table "users" which we split 
into 1:1 relation "users_header" and "users_data". We put searchable 
columns into users_header and rest of them into users_data. users_data 
have some integer foreign key referencing to users_header.

What do you think about it? Does the Postgres use advantages of small 
table users_header? Sequential scan on memory cached table should speed 
up queries, the rest columns are in integer-indexed table which 
shouldn't slow it down.

These example above is ony an idea, I don't have currently any example 
for it.

Regards,
Tomasz Myrta




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: sequential scans on few columns tables
  2003-06-16 19:49 sequential scans on few columns tables Tomasz Myrta <jasiek@klaster.net>
@ 2003-06-16 19:55 ` Bruno Wolff III <bruno@wolff.to>
  2003-06-16 20:32   ` Re: sequential scans on few columns tables Tomasz Myrta <jasiek@klaster.net>
  1 sibling, 1 reply; 4+ messages in thread

From: Bruno Wolff III @ 2003-06-16 19:55 UTC (permalink / raw)
  To: Tomasz Myrta <jasiek@klaster.net>; +Cc: pgsql-performance

On Mon, Jun 16, 2003 at 21:49:40 +0200,
  Tomasz Myrta <jasiek@klaster.net> wrote:
> Hi
> Recently I was wondering about tables difficult to index. Example - 
> queries with "ilike" where clauses. Without additional contrib modules 
> the only way to search such tables is sequential scan (am I right?)

You might be able to use a functional index depending on exactly what your
search patterns are like.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: sequential scans on few columns tables
  2003-06-16 19:49 sequential scans on few columns tables Tomasz Myrta <jasiek@klaster.net>
  2003-06-16 19:55 ` Re: sequential scans on few columns tables Bruno Wolff III <bruno@wolff.to>
@ 2003-06-16 20:32   ` Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Tomasz Myrta @ 2003-06-16 20:32 UTC (permalink / raw)
  To: Bruno Wolff III <bruno@wolff.to>; +Cc: pgsql-performance

Dnia 2003-06-16 21:55, Użytkownik Bruno Wolff III napisał:
> On Mon, Jun 16, 2003 at 21:49:40 +0200,
>   Tomasz Myrta <jasiek@klaster.net> wrote:
> 
>>Hi
>>Recently I was wondering about tables difficult to index. Example - 
>>queries with "ilike" where clauses. Without additional contrib modules 
>>the only way to search such tables is sequential scan (am I right?)
> 
> 
> You might be able to use a functional index depending on exactly what your
> search patterns are like.
Probably functional indexes won't be helpful to find _substrings_.
Tomasz




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: sequential scans on few columns tables
  2003-06-16 19:49 sequential scans on few columns tables Tomasz Myrta <jasiek@klaster.net>
@ 2003-06-16 22:45 ` Jim C. Nasby <jim@nasby.net>
  1 sibling, 0 replies; 4+ messages in thread

From: Jim C. Nasby @ 2003-06-16 22:45 UTC (permalink / raw)
  To: pgsql-performance

On Mon, Jun 16, 2003 at 09:49:40PM +0200, Tomasz Myrta wrote:
> by denormalizing tables. Let's say we have table "users" which we split 
> into 1:1 relation "users_header" and "users_data". We put searchable 
> columns into users_header and rest of them into users_data. users_data 
> have some integer foreign key referencing to users_header.
> 
> What do you think about it? Does the Postgres use advantages of small 
> table users_header? Sequential scan on memory cached table should speed 
> up queries, the rest columns are in integer-indexed table which 
> shouldn't slow it down.
 
Keep in mind that pgsql has a pretty heafty per-row overhead of 23
bytes. If your data table has a bunch of big varchars then it might be
worth it, otherwise it might not be.
-- 
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2003-06-16 22:45 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-06-16 19:49 sequential scans on few columns tables Tomasz Myrta <jasiek@klaster.net>
2003-06-16 19:55 ` Bruno Wolff III <bruno@wolff.to>
2003-06-16 20:32   ` Tomasz Myrta <jasiek@klaster.net>
2003-06-16 22:45 ` Jim C. Nasby <jim@nasby.net>

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