[GENERAL] Do not understand high estimates of index scan vs seq scan

2013-06-20 Thread Antonio Goméz Soto
Hi all, I do not understand why postgreSQL estimates an index scan only half as fast as a seq scan: system=# explain select * from queuelog;QUERY PLAN --- Seq Scan on queuelog (cost=0.00..20530.29 rows=

[GENERAL] Very simple select, using index for ordering, but not for selecting. How to make it faster?

2013-05-22 Thread Antonio Goméz Soto
Hi, I have the following simple query on a simple table: system=# select * from history where lookup = 'trunk' and lookupid = '248' order by created desc limit 1000; system=# \d history Table "public.history" Column | Type |

Re: [GENERAL] Slow query and using wrong index, how to fix? Probably naive question..

2013-05-22 Thread Antonio Goméz Soto
ory.id, history.created, creator, contact, history.type, lookup, > lookupid, value > from history > where creator = '790' > > Leif Gunnar Erlandsen > > > > ____ > Fra: pgsql-general-ow...@postgresql.org [pgsql-general-ow...@po

[GENERAL] Slow query and using wrong index, how to fix? Probably naive question..

2013-05-22 Thread Antonio Goméz Soto
Hi, I am using postgresql 8.1 (CentOS5). I have the following table: system # \d history Table "public.history" Column | Type | Modifiers --+--+--

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-09 Thread Antonio Goméz Soto
Tomas, running vacuum full cdr brought down the query time to 4 seconds.. Thanks a lot, Antonio Op 08-05-12 21:15, Tomas Vondra schreef: > On 8.5.2012 20:32, Antonio Goméz Soto wrote: >>>> Do this on both machines to verify that >>>> >>>>SELECT

Re: [GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-08 Thread Antonio Goméz Soto
Hi Tomas, thanks for responding. Op 08-05-12 17:34, Tomas Vondra schreef: > Hi, > > On 8 Květen 2012, 16:48, Antonio Goméz Soto wrote: >> Hi, >> >> I am running PostgreSQL 8.1, on CentOS 5. I have two machines, same >> hardware, with the same database layout,

[GENERAL] 2 machines, same database, same query, 10 times slower?

2012-05-08 Thread Antonio Goméz Soto
Hi, I am running PostgreSQL 8.1, on CentOS 5. I have two machines, same hardware, with the same database layout, they have different data, and the same query run 10 times as slow on one machine compared to the other. I have run ANALYZE on both machines, here are the query plans for both machin

Re: [GENERAL] What is *wrong* with this query???

2011-11-05 Thread Antonio Goméz Soto
Steve, Op 05-11-11 05:51, Steve Murphy schreef: I give! I'm flummoxed! Here is what I have, 3 tables: schedule company building status0 3 x active 4 x active 5 x active 3 x active 3 x active 3 x active In the end, I want to replace the building id's above. They start out with the non-

Re: [GENERAL] FREE hosting platforms with PostgreSQL, Java SDK, Tomcat, ecc.?

2011-08-06 Thread Antonio Goméz Soto
Well, I am from the hosting business, and can assure you, what you are looking for does not exist. This configuration requires specialists on the provider side, which are expensive. They need to eat too. And history teaches, that even if it would exist, you should not put anything meaningful

Re: [GENERAL] Libpq is very slow on windows but fast on linux.

2010-11-09 Thread Antonio Goméz Soto
Op 10-11-10 08:22, Alban Hertroys schreef: On 10 Nov 2010, at 5:19, Rob Brown-Bayliss wrote: Further testing shows it is windows networking causing the issue. Copying files to and from the server is 5 to 6 times slower on a Windows client compared to the Linux client. The issue is not specific

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Op 02-03-10 16:14, Raymond O'Donnell schreef: On 02/03/2010 14:56, Thom Brown wrote: But I still need to define access to each table separately? Thanks, Antonio. As far as I'm aware. It's only in the upcoming version 9.0 that you can do things like: GRANT SELECT ON ALL TABLES IN SCHEMA pu

Re: [GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Op 02-03-10 13:00, Thom Brown schreef: On 2 March 2010 11:46, Nilesh Govindarajan wrote: On Tue, Mar 2, 2010 at 4:57 PM, Thom Brown wrote: On 2 March 2010 11:12, Antonio Goméz Soto wrote: Hi, I tried this: names=# grant select on database names to spice; ERROR: invalid privilege type

[GENERAL] How to grant a user read-only access to a database?

2010-03-02 Thread Antonio Goméz Soto
Hi, I tried this: names=# grant select on database names to spice; ERROR: invalid privilege type SELECT for database The documentation seems to imply I need to grant SELECT to each table separately. That's a lot of work, and what if new tables are created? Thanks, Antonio -- Sent via pgsql-g

Re: [GENERAL] define transaction within pg/psql. Necessary?

2010-02-18 Thread Antonio Goméz Soto
Op 18-02-10 11:07, Richard Huxton schreef: On 18/02/10 10:02, Antonio Goméz Soto wrote: if I define a pg/pgsql function, and I call that outside a transaction, does it create one for itself? Or should I add BEGIN and COMMIT statements within the function? You can't call a function outs

[GENERAL] define transaction within pg/psql. Necessary?

2010-02-18 Thread Antonio Goméz Soto
Hello, if I define a pg/pgsql function, and I call that outside a transaction, does it create one for itself? Or should I add BEGIN and COMMIT statements within the function? Thanks, Antonio. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscrip

Re: [GENERAL] Using table name in column for joining

2010-01-05 Thread Antonio Goméz Soto
or diferents animals like this: select name <http://animal.name/> from animal; select name <http://animal.name/> from elephant; select name <http://animal.name/> from monkey; I hope it helps. 2010/1/5 Grzegorz Jaśkiewicz mailto:gryz...@gmail.com>> On Tue, Jan 5, 2

[GENERAL] Using table name in column for joining

2010-01-05 Thread Antonio Goméz Soto
Hello, I have a column in a table that contains the name of another table, and the id in that table. I would like to use this in a join statement. Is that possible? example: create table animal ( id serial, table_name varchar(8) default 'monkey' CHECK (table_name IN ('monkey', 'elephant')),

Re: [GENERAL] alter table performance

2009-12-20 Thread Antonio Goméz Soto
Op 19-12-09 22:20, Jaime Casanova schreef: are you planning to run this many times? what is wrong with making this manually? doesn't seem like something to make automatic... but if you insist in plpgsql you can execute "select version() into some_text_var" and act acordingly No, this is don

Re: [GENERAL] alter table performance

2009-12-19 Thread Antonio Goméz Soto
Hi, is there a way in sql to dynamically test for version 7.3, so I can run the alter table add column update table set column = .. where column IS NULL; alter table alter column set not null on 7.3, and on newer versions: alter table add column ... not null default ''; Maybe I can cr

Re: [GENERAL] alter table performance

2009-12-17 Thread Antonio Goméz Soto
Op 17-12-09 23:46, Tom Lane schreef: This is just one of many many things that could be improved by getting off of 7.3. In general, complaining about performance (or features) of a seven-year-old, long since EOL'd release is not a productive use of anybody's time. I'm sorry, didn't mean to

[GENERAL] alter table performance

2009-12-17 Thread Antonio Goméz Soto
Hi, I am regularly altering tables, adding columns setting default values etc. This very often takes a very long time and is very disk intensive, and this gets pretty annoying. Things are hampered by the fact that some of our servers run PG 7.3 Suppose I have a table and I want to add a non NUL