Re: [GENERAL] Seq scan X Index scan

2017-03-08 Thread David G. Johnston
On Wed, Mar 8, 2017 at 3:32 PM, Patrick B wrote: > Why is SEQ SCAN faster than index scan? > Same number of evaluated record and less effort-per-record​. You only win with an index if you can evaluate fewer records to make up for the extra effort per record that querying an index involves compa

Re: [GENERAL] Seq Scan cost shown to be (cost=10000000000.00..10000000001.10)

2013-05-27 Thread Amit Langote
> When one uses “enable_” settings to adjust planner behavior, PostgreSQL > just sets really high costs for the operations affected (like the one you > see). > > As SeqScan is the only possible way to execute your query, it is still > choosen. > I get it. Thanks! -- Amit Langote -- Sent via pg

Re: [GENERAL] Seq Scan cost shown to be (cost=10000000000.00..10000000001.10)

2013-05-27 Thread Amit Langote
>> Although, I suspect the (dropped index + enable_seqscan) causes this, >> is the cost shown in explain output some kind of default max or >> something like that for such abnormal cases? > > When you set enable_xxx=off, it not actually disables the xxx > operation, it sets the start cost to the hi

Re: [GENERAL] Seq Scan cost shown to be (cost=10000000000.00..10000000001.10)

2013-05-27 Thread Victor Yegorov
2013/5/27 Amit Langote > Although, I suspect the (dropped index + enable_seqscan) causes this, > is the cost shown in explain output some kind of default max or > something like that for such abnormal cases? > When one uses “enable_” settings to adjust planner behavior, PostgreSQL just sets real

Re: [GENERAL] Seq Scan cost shown to be (cost=10000000000.00..10000000001.10)

2013-05-27 Thread Sergey Konoplev
On Mon, May 27, 2013 at 12:42 AM, Amit Langote wrote: > I set enable_seqscan=off and also accidentally dropped the only index [...] > Seq Scan on testdata (cost=100.00..101.10 rows=2 width=71) [...] > Although, I suspect the (dropped index + enable_seqscan) causes this, > is the

Re: [GENERAL] seq-scan or index-scan

2012-07-04 Thread Andreas Kretschmer
Tom Lane wrote: > Andreas Kretschmer writes: > > production=*# explain analyse select * from boxes; > > QUERY PLAN > > --- > > Seq Scan o

Re: [GENERAL] seq-scan or index-scan

2012-07-03 Thread Tom Lane
Andreas Kretschmer writes: > production=*# explain analyse select * from boxes; > QUERY PLAN > --- > Seq Scan on boxes (cost=0.00..990783.

Re: [GENERAL] seq-scan or index-scan

2012-07-03 Thread Tomas Vondra
On 3 Červenec 2012, 17:58, Andreas Kretschmer wrote: > Dear list, > > i have a table and i'm selecting all records without a where-condition, > and i don't need a ORDER BY: > > > > production=*# explain analyse select * from boxes; > QUERY PLAN > --

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tyler Durden
Ok, Thank all for the clarification. ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tom Lane
Kevin Hunter <[EMAIL PROTECTED]> writes: > At 1:17p -0400 on 01 Jun 2007, Tyler Durden wrote: >> I find strange that a simple SELECT COUNT(...) is so slow with only >> 700 000 records. > The much more knowledgable will correct me, but the abbr. version is > that it is for data integrity and corr

Re: [GENERAL] Seq Scan

2007-06-01 Thread Kevin Hunter
of the conversation. breaks the flow because it toppost Please don't At 1:17p -0400 on 01 Jun 2007, Tyler Durden wrote: Yes, either case happens the same. I'm come recently from MySQL and it works in a different way. I find strange that a simple SELECT COUNT(...) is so slow with only 700 000 re

Re: [GENERAL] Seq Scan

2007-06-01 Thread Joshua D. Drake
Tyler Durden wrote: Hi, I'm having some problems in performance in a simple select count(id) from I have 700 000 records in one table, and when I do: # explain select (id) from table_name; -[ RECORD 1 ] QUERY PLAN | Seq Scan on

Re: [GENERAL] Seq Scan

2007-06-01 Thread Reece Hart
On Fri, 2007-06-01 at 18:24 +0100, Tyler Durden wrote: > It uses Index Scan for id>20 and Seq Scan for id>10?! Based on the statistics pg has for your table, and on the cost of using the index, the cost based optimizer decided that it's more efficient to seq scan all of the rows than to incu

Re: [GENERAL] Seq Scan

2007-06-01 Thread Michael Glaesemann
On Jun 1, 2007, at 12:24 , Tyler Durden wrote: On 6/1/07, Joshua D. Drake <[EMAIL PROTECTED]> wrote: Nothing. You have to scan the table because you aren't giving postgresql anything to use the index by. # explain ANALYZE select id from table_name where id>20;

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tyler Durden
Ok, my bad. But why this happens: # explain ANALYZE select id from table_name where id>20; QUERY PLAN

Re: [GENERAL] Seq Scan

2007-06-01 Thread Tyler Durden
Yes, either case happens the same. I'm come recently from MySQL and it works in a different way. I find strange that a simple SELECT COUNT(...) is so slow with only 700 000 records. Has been a nightmare optimizing this tables/queries. Sorry about this silly question, but I'm new to Posgresql. Th

Re: [GENERAL] Seq Scan

2007-06-01 Thread John D. Burger
Tyler Durden wrote: I'm having some problems in performance in a simple select count(id) from I have 700 000 records in one table, and when I do: # explain select (id) from table_name; -[ RECORD 1 ] QUERY PLAN | Seq Scan on t

Re: [GENERAL] Seq Scan but I think it should be Index Scan

2005-10-26 Thread Michael Fuhr
On Wed, Oct 26, 2005 at 06:55:54PM -0700, Edoceo Lists wrote: > I'm thinking that my queries are not using indexs correctly and > therefore taking longer to complete than they should. Index scans aren't necessarily faster than sequential scans: if the query reads a significant amount of the table

Re: [GENERAL] Seq scan of table?

2003-09-05 Thread Jonathan Bartlett
> I think I have found out why.. I have a where clause on a ID field but it > seems like I need to cast this integer to the same integer as the field is > defined in the table, else it will do a tablescan. Yes, this is correct > Is this assumtion correct? And if it is, do I then need to change al