[SQL] Partial index and query plan

2007-08-22 Thread Aleksandr Vinokurov
Hello all, Imagine having this table: create table user_history ( rec_id SERIAL not null, date TIMESTAMPnot null, action INT2 not null, uid INT4 not null, name C

Re: [SQL] Partial index and query plan

2007-08-22 Thread Aleksandr Vinokurov
07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Aleksandr Vinokurov" <[EMAIL PROTECTED]> writes: > > The question is why "explain analyze" shows a 'Filter: ("action" <> 0)' in > > plan: > > Use a newer Postgres r

Re: [SQL] Partial index and query plan

2007-08-22 Thread Aleksandr Vinokurov
Scott Marlowe wrote: > > I don't see the issue here. The index being used is the same partial > index you created. Maybe it's just a question of semantics? > As I understand final filter is: a) pointed at the index creation b) is redundant as all the indexed records have action

[SQL] Incomprehensible dogged sort in Merge Join

2007-08-31 Thread Aleksandr Vinokurov
Hello all, Trying to get an extra time savings in my query, I stopped at an unusual doggedness of the planner. Here is the query: >-< select * from ( select * from "user_history" order by name ) as uh

Re: [SQL] Incomprehensible dogged sort in Merge Join

2007-08-31 Thread Aleksandr Vinokurov
Gregory Stark wrote: "Aleksandr Vinokurov" <[EMAIL PROTECTED]> writes: And that is its plan (attached one is the same, but with costs): -< Merge Left Join Merge Cond: ("outer".name = "inne

Re: [SQL] Incomprehensible dogged sort in Merge Join

2007-08-31 Thread Aleksandr Vinokurov
Tom Lane wrote: Aleksandr Vinokurov <[EMAIL PROTECTED]> writes: Trying to get an extra time savings in my query, I stopped at an unusual doggedness of the planner. Merge Left Join Merge Cond: ("outer".name = "inner".name) -> Sort Sort Key: lo

Re: [SQL] Incomprehensible dogged sort in Merge Join

2007-08-31 Thread Aleksandr Vinokurov
Alvaro Herrera wrote: Aleksandr Vinokurov escribió: Tom Lane wrote: When criticizing planner deficiencies, it's considered polite to use something that's less than two major releases back ;-) Sorry, it was blown out from my head at the end of composing: my version is 8.0.1, not so

[SQL] 8.0.1 to 8.0.13 upgrade added 15% lack of time of query execution

2007-09-04 Thread Aleksandr Vinokurov
Hello all, I beg your pardon if I do not know some thing, but I was disappointed after taken an upgrade from 8.0.1 to 8.0.13, now the query, that I had optimized so far to run for 92 sec on 8.0.1, takes 106 seconds on 8.0.13. The plan seems to stay unmodified, except statistics used for its

Re: [SQL] 8.0.1 to 8.0.13 upgrade added 15% lack of time of query execution

2007-09-05 Thread Aleksandr Vinokurov
Sorry, just noticed that both query plans are actually for the 8.0.13 release. This one is right: "Total runtime: 93866.526 ms" Any suggestions? Please. Aleksandr Vinokurov wrote: Both plans with queries echoed are attached to this email. Timing is on. explain analyze

[SQL] SERIAL type's sequence is double-called or ?

2007-09-07 Thread Aleksandr Vinokurov
Hello all, I have a question with the SERIAL type. I want to use it for default identification of table entries: create table chuwee ( num serial primary key, mesg varchar(50) not null ); And all the inserts to this table I'm gonna log to this table: create table chuwee_log ( id seri