Re: Re: postgres slower than grep? - Mailing list pgsql-general

From Mitch Vincent
Subject Re: Re: postgres slower than grep?
Date
Msg-id 006c01c10951$fba5c2b0$1251000a@Mitch
Whole thread Raw
In response to Re: postgres slower than grep?  (Allan Engelhardt <allane@cybaea.com>)
List pgsql-general
> 1. I find about 50% database storage overhead in this case.  That's not
completely silly, considering this is structured data, but seems a little
high.  I don't know >the internal structures well enough to really see
what's happening.

Hmm, the PG docs say to expect data stored in the database to take up %600
(or so) more space..

see: http://postgresql.bteg.net/docs/faq-english.html#4.7

> 2. Why would it be faster than grep?  This has to match structured data,
in this case varchar, and not just bytes.  It has to worry about
transactions and logs, not >just a stream of data.  Besides, in my tests it
is not *that* slow (3 sec, compared with 1/2).  Dunno what's up with your
system.

Sure, I'd expect grep to find a string in a semi-large text file faster than
PostgreSQL -- there is a hell of a lot less overhead with grep! :-)

> 3. As you said: With an index it rocks, easily beating grep.  Use an
index - it's your friend :-)

Yep yep!

-Mitch


pgsql-general by date:

Previous
From: Fernando Schapachnik
Date:
Subject: TCL and encoding
Next
From: Martijn van Oosterhout
Date:
Subject: Re: [PATCH] Partial indicies again