Re: [HACKERS] GROUP BY / ORDER BY string is very slow

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: phd2(at)earthling(dot)net
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] GROUP BY / ORDER BY string is very slow
Date: 1999-01-22 05:50:40
Message-ID: 36A811B0.12D9E787@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Once a month I run a very simple script to put WWW logs into the
> table.
> What is worse is spped of my queries.
> Why is it so slow? How can I speed it up?

Are you running vacuum after removing your indices? If you don't then
the table storage area does not actually shrink.

> I am running postgres compiled with --enable-locale. that is, for
> every string comparision there are 2 (two) malloc calls and one
> strcoll. Can I increase speed turning strcoll off? If so, postgres
> need a SET command to turn localization temporary off.

How can you "turn localization off" if you have localized strings in
your database? If you build indices without localization, then turn
localization back on, the things are probably hopelessly out of order.

> I remember when I submitted my locale patch there was a discussion on
> how to do it the Right Way, but I didn't remember the conlusion. What
> finally we decided? I want to add command (if I should to) that is
> compliant with other stuff here.

Is the Right Way to implement the NATIONAL CHARACTER type rather than
having the CHAR type be localized? That way, you could have both types
in the same database. Or is that SQL92 feature not widely used or
useful?

- Tom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1999-01-22 06:04:09 Re: [HACKERS] ecpg docs
Previous Message Bruce Momjian 1999-01-22 04:37:37 Re: [HACKERS] SPI_prepare() doesn't work well ?