I have a postgresql DB in which I do a lot of string matching ala :

UPDATE table1 SET colum1 = TRUE WHERE colum2 LIKE '%teststring%';

colum2 is a whole html file

As I said I do A LOT of this and I'm looking for a CPU that can do this faster. Because my understanding is that the pattern matching is mostly CPU bound. So which CPU benchmark targets this kind of workload?

  • Perhaps you don't need a faster CPU, but should be using Text Search postgresql.org/docs/9.3/static/textsearch-intro.html or using the right indexes stackoverflow.com/questions/1566717/… – Neil McGuigan Aug 19 '14 at 19:29
  • Don't guess that it's CPU-bound. Measure and determine that. It'll only be CPU bound if the dataset is small enough to fit in RAM. Otherwise it'll almost certainly be limited by disk I/O. "top" is a good start. – Craig Ringer Aug 20 '14 at 1:10
  • You might also want to look into the infix search trigram GiST indexes provided by pg_trgm - though if your workload is update-heavy the extra work of maintaining the index might offset any benefits from using it. Worth a try. – Craig Ringer Aug 20 '14 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.