EnterpriseDB: The Enterprise Postgres Company Postgres Plus Forums: The PostgreSQL Open Source Database from EnterpriseDB
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 

Not able retieve records even though data is available in the table  XML

Forum Index » GridSQL - General
Author Message
sri_v

Member

Joined: 4 Dec 2009 07:54:27
Messages: 25
Offline

Hi,

We are using GridSQL 1.1.0.9 with postgresplus standard server.
We are having problem in getting records even though data is available in the table.

GridSQL -> select count(*) from test where served_number='779294936';
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row(s).


GridSQL -> select served_number from test where served_number like '%779294936%';
+---------------+
| served_number |
+---------------+
| 779294936 |
| 779294936 |
| 779294936 |
| 779294936 |
| 779294936 |
+---------------+
5 row(s).


GridSQL -> select served_number,length(served_number) from test where served_number like '%779294936%';
+------------------------+
| served_number | length |
+------------------------+
| 779294936 | 9 |
| 779294936 | 9 |
| 779294936 | 9 |
| 779294936 | 9 |
| 779294936 | 9 |
+------------------------+

It is working fine if we use trim,but is not required as the above query shows all the records are having same length.

If we create a temp table with create table test1 as select served_number from test;
select count(*) from test1 where served_number='779294936';
+----------+
| count(*) |
+----------+
| 5 |
+----------+

Then it is working fine.
What can be the reson for this problem?


Thanks
Sri

Andrei_M

Senior member

Joined: 19 Dec 2008 01:37:13
Messages: 116
Offline

Hi Sri,

May be your table is partitioned by served_number and partitioning got corrupted.
Queries with conditions like column=constant are optimized and run only on single node, matching the constant.
Queries with LIKE runs on all nodes.

I would recommend to reload data your table:

COPY table TO file
TRUNCATE table
COPY table FROM file

Andrei

Thanks
Andrei
Mason_S

Senior member

Joined: 1 Apr 2008 09:03:08
Messages: 380
Offline

Is served_number a character field then? Are there any leading or trailing spaces?

Mason
[WWW]
 
Forum Index » GridSQL - General
Go to:   
Powered by JForum 2.1.8 © JForum Team