Re: [SQL] UPDATE and DELEte with a lot of register is to slow...
O Problema é tem tenho uma tabela muito grande com chave primaria e tudo mais... e quando eu vou fazer uma atualização de alguns campos desta tabela o banco fica devagar estou procurando algum comando que me permita atualizar os registros aos poucos por exemplo uma tabela com 100 000 atualiza-la de 1 000 em 1 000 até que possa terminar assim as outros usuarios não sentirão . quando temos algo muito grande no postgres ele continua a reservar recursos para o processo que eu estou rodando (neste caso a ataualização muito grande) fazendo com qfue os outros usuarios tenham perda de desenpenho. Obrigado 2008/11/20 John Dizaro <[EMAIL PROTECTED]> > I have to execute some times an UPDATE an some times a DELETE to > register +- 5 , every time when i do that the database be to slow > do we any way to DELETE or UPDATE by part??? > Thanks > > -- > John Evan Dizaro - > > > -- John Evan Dizaro Software - Fone: (41) -0303 Fone: (41) 9243-3240 Rua: Alferes Poli Curitiba - PR - Brasil
[SQL] wired behaviour
Hello, I have an problem understanding a simple query: For example I have the following: select count(*) from foo; gives me 1000 select count(*) from foo where bar = 'Mr Spock'; gives me 5 select count(*) from foo where NOT bar = 'Mr Spock'; gives me 857 Why I'm not getting 955 for the last query ? Any idea ? Kindly regards Lutz -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
NULL values? Met vriendelijke groet, Paul Dam Informatieanalist Amyyon Bijsterhuizen 11.58 6546 AS Nijmegen 050 - 311 5686 www.amyyon.nl -Oorspronkelijk bericht- Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens Lutz Steinborn Verzonden: vrijdag 28 november 2008 14:52 Aan: [email protected] Onderwerp: [SQL] wired behaviour Hello, I have an problem understanding a simple query: For example I have the following: select count(*) from foo; gives me 1000 select count(*) from foo where bar = 'Mr Spock'; gives me 5 select count(*) from foo where NOT bar = 'Mr Spock'; gives me 857 Why I'm not getting 955 for the last query ? Any idea ? Kindly regards Lutz -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
On Nov 28, 2008, at 8:51 AM, Lutz Steinborn wrote: Hello, I have an problem understanding a simple query: For example I have the following: select count(*) from foo; gives me 1000 select count(*) from foo where bar = 'Mr Spock'; gives me 5 select count(*) from foo where NOT bar = 'Mr Spock'; gives me 857 Why I'm not getting 955 for the last query ? Any idea ? Do you happen to have any NULL values on the field bar?? Ries -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
Hello Paul, thanks for the quick answer. > NULL values? Jepp, thats it. I've supposed this but can't believe it. So NULL is something out of this dimension :-) Kindly regards Lutz > > Met vriendelijke groet, > > Paul Dam > Informatieanalist > > > > > Amyyon > Bijsterhuizen 11.58 > 6546 AS Nijmegen > 050 - 311 5686 > www.amyyon.nl > -Oorspronkelijk bericht- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Namens Lutz Steinborn > Verzonden: vrijdag 28 november 2008 14:52 > Aan: [email protected] > Onderwerp: [SQL] wired behaviour > > Hello, > > I have an problem understanding a simple query: > > For example I have the following: > select count(*) from foo; > gives me 1000 > > select count(*) from foo where bar = 'Mr Spock'; > gives me 5 > > select count(*) from foo where NOT bar = 'Mr Spock'; > gives me 857 > > Why I'm not getting 955 for the last query ? > > > Any idea ? > > Kindly regards > > > Lutz > > -- > Sent via pgsql-sql mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql > > -- > Sent via pgsql-sql mailing list ([email protected]) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql -- Lutz Steinborn 4c Business Service GmbH Putzbrunner Str. 71 81739 M_nchen Fon: +49 89 99341 30, Fax +49 89 99341 399 [EMAIL PROTECTED], http://www.4c-shopping.de - Sitz der Gesellschaft: Putzbrunner Str. 71, 81739 Muenchen Vertretungsberechtigter Geschaeftsfuehrer: Frank W. Lutze Registergericht: Amtsgericht Muenchen Registernummer: HR 130 207 Ustnr. gemaess _ 27 a Umsatzsteuergesetz: DE 206 864 106 -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
On fös, 2008-11-28 at 15:22 +0100, Lutz Steinborn wrote: > Hello Paul, > > thanks for the quick answer. > > > NULL values? > Jepp, thats it. > I've supposed this but can't believe it. So NULL is something out of this > dimension :-) Yes, that is one way of putting it. A more useful way to look at it is to say that NULL represents an UNKNOWN value. rows with NULL bar value will not be counted by: > > select count(*) from foo where bar = 'Mr Spock'; because you cannot know whether the UNKNOWN value is 'Mr Spock'. these rows will neither be counted by: > > select count(*) from foo where NOT bar = 'Mr Spock'; because you also cannot know that the UNKNOWN value is NOT 'Mr Spock'. Does that make it any clearer? gnari -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
Lutz Steinborn wrote: Hello Paul, thanks for the quick answer. NULL values? Jepp, thats it. I've supposed this but can't believe it. So NULL is something out of this dimension :-) Kindly regards Lutz NULL refers to an unknown value - it cannot be said to equal or not equal anything other than NULL It is a concept that catches those new to databases (and sometimes not so new). -- Shane Ambler pgSQL (at) Sheeky (dot) Biz Get Sheeky @ http://Sheeky.Biz -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] wired behaviour
--- On Fri, 11/28/08, Lutz Steinborn <[EMAIL PROTECTED]> wrote: > From: Lutz Steinborn <[EMAIL PROTECTED]> > Subject: [SQL] wired behaviour > To: [email protected] > Date: Friday, November 28, 2008, 1:51 PM > Hello, > > I have an problem understanding a simple query: > > For example I have the following: > select count(*) from foo; > gives me 1000 > > select count(*) from foo where bar = 'Mr Spock'; > gives me 5 > > select count(*) from foo where NOT bar = 'Mr > Spock'; > gives me 857 > > Why I'm not getting 955 for the last query ? > > > Any idea ? > > Kindly regards > > > Lutz > > -- Probably you have null values in bar column -- Sent via pgsql-sql mailing list ([email protected]) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] Converting between UUID and VARCHAR
Didn't you create those other tables with "character varying" too? If
you did i think that you need to change those tables too.
On Mon, Nov 10, 2008 at 12:44 PM, A. Kretschmer
<[EMAIL PROTECTED]> wrote:
> am Mon, dem 10.11.2008, um 15:34:10 +0100 mailte Mario Splivalo folgendes:
>> I have a table, like this:
>>
>> CREATE TABLE t1
>> (
>> u1 character varying
>> )
>>
>> And some data inside:
>>
>> INSERT INTO t1 (u1) VALUES ('62d6b434-7dfd-4b3b-b1bf-87f6c20c10dd');
>> INSERT INTO t1 (u1) VALUES ('e3fee596-164b-4995-9e0d-7b2a79e83752');
>>
>> Now, I can do this:
>>
>> SELECT u1::uuid FROM t1;
>>
>> But I can't do this:
>>
>> ALTER TABLE t1 ALTER u1 TYPE uuid;
>
> test=# CREATE TABLE t1
> test-# (
> test(# u1 character varying
> test(# )
> test-# ;
> CREATE TABLE
> test=# INSERT INTO t1 (u1) VALUES
> ('62d6b434-7dfd-4b3b-b1bf-87f6c20c10dd');
> INSERT 0 1
> test=# alter table t1 alter column u1 type uuid using u1::uuid;
> ALTER TABLE
> test=# \d t1;
> Table "public.t1"
> Column | Type | Modifiers
> +--+---
> u1 | uuid |
>
>
>
> Andreas
> --
> Andreas Kretschmer
> Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
> GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
>
> --
> Sent via pgsql-sql mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>
--
Helio Campos Mello de Andrade
--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
