"Ulrich" <[EMAIL PROTECTED]> writes:
> EXPLAIN ANALYZE SELECT speed FROM processors WHERE id IN (SELECT processorid
> FROM users_processors WHERE userid=4040) ORDER BY speed ASC LIMIT 10 OFFSET 1;
>
> Limit (cost=113.73..113.75 rows=7 width=5) (actual time=0.335..0.340 rows=10
> loops=1)
> ->
Hi,
I have added a bit of dummy Data, 10 processors, 1 users, each
user got around 12 processors.
I have tested both queries. First of all, I was surprised that it is
that fast :) Here are the results:
EXPLAIN ANALYZE SELECT speed FROM processors WHERE id IN (SELECT
processorid FRO
On Sat, Jun 28, 2008 at 06:24:42PM +0200, Moritz Onken wrote:
> SELECT distinct url from item where url like 'http://www.micro%' limit
> 10;
Here, the planner knows the pattern beforehand, and can see that it's a
simple prefix.
> select *
> from result
> where exists
>(select * from item w
Hi,
I have a query
select count(*)
from result
where exists
(select * from item where item.url LIKE result.url || '%' limit 1);
which basically returns the number of items which exist in table
result and match a URL in table item by its prefix.
I read all about idexes (http://www.postgre
Ulrich <[EMAIL PROTECTED]> writes:
> People say that [EXISTS is faster]
People who say that are not reliable authorities, at least as far as
Postgres is concerned. But it is always a bad idea to extrapolate
results on toy tables to large tables --- quite aside from measurement
noise and caching i
Hi,
I am new to SQL and have two tables..., "processor" and
"users_processors". The first table contains Processors:
CREATE TABLE processor (
id SERIAL,
speed varchar(50) NOT NULL,
type int2 NOT NULL,
PRIMARY KEY (id)
);
CREATE UNIQUE INDEX processor_speed_index ON processors(lower(speed));
E