Re: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Francisco Olarte
Job: On Fri, Dec 30, 2016 at 1:01 PM, Alban Hertroys wrote: >> On 30 Dec 2016, at 11:42, Job wrote: ... >> The index applied on the timestamp field is a btree("timestamp") ... >> select domain, sum(accessi) as c_count from TABLE where action='1' AND >> profile IN ('PROFILE_CODE') AND timestamp:

R: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Job
Hi Alban, I was wrong: i have only one column: tsrarnge. Which index can i create to use this statement fastly: ... AND timestamp <@ '[2016-12-27 00:00:00, 2016-12-31 00:00:00)'::tsrange Thank you again! /F -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

R: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Job
Dear Alban, Regarding: >>... AND timestamp BETWEEN '2016-12-27 00:00:00'::timestamp with time zone AND >>'2016-12-30 23:59:59'::timestamp with time zone ... I think it is a very good approach, and i would like to try. My table has got two different field for "starting" and "ending" timestamp

Re: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Alban Hertroys
> On 30 Dec 2016, at 11:42, Job wrote: > >>> And, basically, if you need help with some queries you could try >>> posting them whole, even redacted, along the table defs, this way >>> perople can see the problem and not invent one based on a partial >>> description > > Thank you very much, very

Re: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Charles Clavadetscher
ct: R: [GENERAL] Special index for "like"-based query > > >>And, basically, if you need help with some queries you could try > >>posting them whole, even redacted, along the table defs, this way > >>perople can see the problem and not invent one based on a

R: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Job
>>And, basically, if you need help with some queries you could try >>posting them whole, even redacted, along the table defs, this way >>perople can see the problem and not invent one based on a partial >>description Thank you very much, very kind from you. The index applied on the timestamp fiel

Re: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Francisco Olarte
On Fri, Dec 30, 2016 at 11:00 AM, Job wrote: > I tried to create a GIST/GIN index on a timestamp without time zone field > but it does not work. > Are there alternatives index types or timezone could speed query up? Remember a timestamp is just a real number ( a point on the time line ) with some

R: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Job
conto di Job [j...@colliniconsulting.it] Inviato: venerdì 30 dicembre 2016 10.55 A: David G. Johnston Cc: pgsql-general@postgresql.org Oggetto: R: [GENERAL] Special index for "like"-based query >>GIST​ >>https://www.postgresql.org/docs/9.6/static/pgtrgm.html >>​https:/

R: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Job
e can mix date and time parameters? Thank you again! /F Da: David G. Johnston [david.g.johns...@gmail.com] Inviato: venerdì 30 dicembre 2016 0.33 A: Job Cc: pgsql-general@postgresql.org Oggetto: Re: [GENERAL] Special index for "like"-based query On Thu,

Re: [GENERAL] Special index for "like"-based query

2016-12-29 Thread David G. Johnston
On Thu, Dec 29, 2016 at 4:51 PM, Tomas Vondra wrote: > On 12/30/2016 12:46 AM, David G. Johnston wrote: > >> On Thu, Dec 29, 2016 at 4:38 PM, Tomas Vondra >> mailto:tomas.von...@2ndquadrant.com >> >>wrote: >> >> On 12/30/2016 12:33 AM, David G. Johnston wrote: >> >> On Thu, Dec 29, 20

Re: [GENERAL] Special index for "like"-based query

2016-12-29 Thread Tomas Vondra
On 12/30/2016 12:46 AM, David G. Johnston wrote: On Thu, Dec 29, 2016 at 4:38 PM, Tomas Vondra mailto:tomas.von...@2ndquadrant.com>>wrote: On 12/30/2016 12:33 AM, David G. Johnston wrote: On Thu, Dec 29, 2016 at 4:21 PM, Job mailto:j...@colliniconsulting.it>

Re: [GENERAL] Special index for "like"-based query

2016-12-29 Thread David G. Johnston
On Thu, Dec 29, 2016 at 4:38 PM, Tomas Vondra wrote: > On 12/30/2016 12:33 AM, David G. Johnston wrote: > >> On Thu, Dec 29, 2016 at 4:21 PM, Job > >wrote: >> >> Hello, >> >> in Postgresql 9.6 we have a query running on a very large table >> based, in

Re: [GENERAL] Special index for "like"-based query

2016-12-29 Thread Tomas Vondra
On 12/30/2016 12:33 AM, David G. Johnston wrote: On Thu, Dec 29, 2016 at 4:21 PM, Job mailto:j...@colliniconsulting.it>>wrote: Hello, in Postgresql 9.6 we have a query running on a very large table based, in some cases, on a like statement: ... WHERE FIELD='CODE' OR FIELD LIKE

Re: [GENERAL] Special index for "like"-based query

2016-12-29 Thread David G. Johnston
On Thu, Dec 29, 2016 at 4:21 PM, Job wrote: > Hello, > > in Postgresql 9.6 we have a query running on a very large table based, in > some cases, on a like statement: > > ... WHERE FIELD='CODE' OR FIELD LIKE 'CODE_%' > > Which type of index can i create to speed to the search when the "like" > cas

[GENERAL] Special index for "like"-based query

2016-12-29 Thread Job
Hello, in Postgresql 9.6 we have a query running on a very large table based, in some cases, on a like statement: ... WHERE FIELD='CODE' OR FIELD LIKE 'CODE_%' Which type of index can i create to speed to the search when the "like" case happens? Thank you! /F -- Sent via pgsql-general mail