On 20/12/13 06:53, Shaun Thomas wrote:
On 12/17/2013 08:48 PM, Kai Sellgren wrote:
This is your select:
SELECT *
FROM "Log"
LEFT JOIN "NewsArticle" ON "NewsArticle".id = "Log"."targetId" AND
"Log"."targetType" = 'NewsArticle'
ORDER BY "Log"."createdAt" DESC
LIMIT 10
This is your index:
CRE
On 12/17/2013 08:48 PM, Kai Sellgren wrote:
This is your select:
SELECT *
FROM "Log"
LEFT JOIN "NewsArticle" ON "NewsArticle".id = "Log"."targetId" AND
"Log"."targetType" = 'NewsArticle'
ORDER BY "Log"."createdAt" DESC
LIMIT 10
This is your index:
CREATE INDEX "Log_targetId_targetType_idx"
Hi,
I'm new to PostgreSQL and trying to run this query:
SELECT *
FROM "Log"
LEFT JOIN "NewsArticle" ON "NewsArticle".id = "Log"."targetId" AND
"Log"."targetType" = 'NewsArticle'
ORDER BY "Log"."createdAt" DESC
LIMIT 10
Basically I'm finding the last 10 log entries, which point (targetType) to
ne
esql.org
Subject: Re: [PERFORM] Optimizing a query
>>>>> "Husam" == Tomeh, Husam <[EMAIL PROTECTED]> writes:
Husam> Have you run vacuum/analyze on the table?
Yes, back when I first noticed how slow it was.
It did not make any difference.
explain analyze says:
,
| n=
> "Husam" == Tomeh, Husam <[EMAIL PROTECTED]> writes:
Husam> Have you run vacuum/analyze on the table?
Yes, back when I first noticed how slow it was.
It did not make any difference.
explain analyze says:
,
| n=# explain analyse select * from nanpa where npa=775 and nxx=473;
|
James Cloos <[EMAIL PROTECTED]> writes:
> ... and was doing queries of the form:
> | select * from nanpa where npa=775 and nxx=413;
If those are char(3) columns, shouldn't you be quoting the constants?
select * from nanpa where npa='775' and nxx='413';
Any non-numeric input will fail entirely wi
Have you run vacuum/analyze on the table?
--
Husam
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of James Cloos
Sent: Wednesday, December 13, 2006 10:48 AM
To: pgsql-performance@postgresql.org
Subject: [PERFORM] Optimizing a query
I've currentl
I've currently got this table:
,
| n=# \d nanpa
| Table "public.nanpa"
|Column | Type | Modifiers
| +--+---
| state | character(2) |
| npa| character(3) | not null
| nxx| character(3) | not null
| ocn| ch